coff32del.c (496B)
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 #include <scc/mach.h> 5 #include <scc/coff32.h> 6 7 #include "../libmach.h" 8 #include "fun.h" 9 10 void 11 coff32del(Obj *obj) 12 { 13 int i; 14 struct coff32 *coff = obj->data; 15 16 if (coff) { 17 free(coff->scns); 18 free(coff->ents); 19 free(coff->strtbl); 20 21 for (i = 0; i < coff->hdr.f_nscns; i++) { 22 if (coff->rels) 23 free(coff->rels[i]); 24 if (coff->lines) 25 free(coff->lines[i]); 26 } 27 free(coff->rels); 28 free(coff->lines); 29 } 30 free(obj->data); 31 obj->data = NULL; 32 }