diff options
Diffstat (limited to 'masm/asm.c')
-rw-r--r-- | masm/asm.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -315,7 +315,7 @@ static int assemble_phdr(struct assembler *assembler, Elf32_Phdr **res, Elf32_Phdr *phdr = malloc(sizeof(Elf32_Phdr) * assembler->sectab.len); if (phdr == NULL) { - ERROR("cannot alloc"); + PERROR("cannot alloc"); return M_ERROR;; } @@ -354,6 +354,11 @@ static int assemble_shdr(struct assembler *assembler, Elf32_Shdr **res, Elf32_Shdr *shdr = malloc(sizeof(Elf32_Shdr) * max_entries); + if (shdr == NULL) { + PERROR("cannot alloc"); + return M_ERROR; + } + size_t str_off; uint32_t count = 0; @@ -593,7 +598,7 @@ static int write_file(struct assembler *assembler, Elf32_Ehdr *ehdr, if (out == NULL) { - ERROR("cannot write '%s'", path); + PERROR("cannot write '%s'", path); return M_ERROR; } |