* Fix segfault in r_bin_elf

This commit is contained in:
Nibble 2010-04-07 11:08:43 +02:00
parent 508e4f596a
commit acba7af2b1

View File

@ -478,7 +478,16 @@ struct r_bin_elf_lib_t* Elf_(r_bin_elf_get_libs)(struct Elf_(r_bin_elf_obj_t) *b
ret[k].last = 0;
k++;
}
ret[k].last = 1;
if (k) {
ret = realloc (ret, (k+1) * sizeof(struct r_bin_elf_lib_t));
if (ret == NULL) {
perror ("realloc (libs)");
free (dyn);
return NULL;
}
ret[k].last = 1;
}
free (dyn);
break;
}