* We found the length of the section name, now seek back to the
* beginning of the name and copy it in the newly allocated buffer.
*/
- name = (char *)zmalloc(sizeof(char) * (name_length + 1)); /* + 1 for \0 */
+ name = calloc<char>((name_length + 1)); /* + 1 for \0 */
if (!name) {
PERROR("Error allocating ELF section name buffer");
goto error;
goto end;
}
- elf->ehdr = (lttng_elf_ehdr *) zmalloc(sizeof(struct lttng_elf_ehdr));
+ elf->ehdr = zmalloc<lttng_elf_ehdr>();
if (!elf->ehdr) {
PERROR("Error allocation buffer for ELF header");
ret = LTTNG_ERR_NOMEM;
goto error;
}
- elf = (lttng_elf *) zmalloc(sizeof(struct lttng_elf));
+ elf = zmalloc<lttng_elf>();
if (!elf) {
PERROR("Error allocating struct lttng_elf");
goto error;
max_alloc_size);
goto error;
}
- data = (char *) zmalloc(shdr->sh_size);
+ data = calloc<char>(shdr->sh_size);
if (!data) {
PERROR("Error allocating buffer for ELF section data");
goto error;