Fix sizeof() operand mismatch warning (thanks fam)

This commit is contained in:
pancake 2013-04-29 18:49:26 +02:00
parent 1e325fc5b0
commit eeceed230b

View file

@ -733,11 +733,13 @@ struct r_bin_elf_reloc_t* Elf_(r_bin_elf_get_relocs)(struct Elf_(r_bin_elf_obj_t
1);
if (len == -1) {
eprintf ("Error: read (rel)\n");
free(rel);
return NULL;
}
}
if ((ret = (struct r_bin_elf_reloc_t *)malloc ((nrel+1) * sizeof (struct r_bin_elf_reloc_t))) == NULL) {
perror ("malloc (reloc)");
free(rel);
return NULL;
}
j = 0;
@ -761,6 +763,7 @@ struct r_bin_elf_reloc_t* Elf_(r_bin_elf_get_relocs)(struct Elf_(r_bin_elf_obj_t
ret[j].last = 1;
break;
}
free(rel);
return ret;
}