Fix null deref in quit when loading corrupted machos ##bin

This commit is contained in:
pancake 2020-06-16 00:06:37 +02:00 committed by Anton Kochkov
parent 50d0e82e9a
commit 00b76ab433

View File

@ -2057,10 +2057,12 @@ void *MACH0_(mach0_free)(struct MACH0_(obj_t) *mo) {
}
size_t i;
for (i = 0; !mo->symbols[i].last; i++) {
free (mo->symbols[i].name);
if (mo->symbols) {
for (i = 0; !mo->symbols[i].last; i++) {
free (mo->symbols[i].name);
}
free (mo->symbols);
}
free (mo->symbols);
free (mo->segs);
free (mo->sects);
free (mo->symtab);