libmach: plug another memory leak

Change-Id: Ia5c888db1f0ded2aa92238d994239e46bf52667a
This commit is contained in:
Neven Sajko 2019-08-11 02:11:02 +00:00 committed by Dan Cross
parent 2c97de1a26
commit 2897735523

View file

@ -69,6 +69,7 @@ crackhdr(char *name, int mode)
return hdr;
}
werrstr("unknown file type: %r");
free(hdr->filename);
free(hdr);
close(fd);
return nil;
@ -89,6 +90,7 @@ uncrackhdr(Fhdr *hdr)
for(i=0; i<hdr->nthread; i++)
free(hdr->thread[i].ureg);
free(hdr->thread);
free(hdr->filename);
free(hdr);
}