comparison files.c @ 38:b156910b59b2

Wrap free() in dofree() to allow instrumenting it for debugging.
author David A. Holland
date Sat, 30 Mar 2013 21:02:25 -0400
parents 76c114899f63
children 337110e7240a
comparison
equal deleted inserted replaced
37:70902cac4170 38:b156910b59b2
68 68
69 static 69 static
70 void 70 void
71 incdir_destroy(struct incdir *id) 71 incdir_destroy(struct incdir *id)
72 { 72 {
73 free(id); 73 dofree(id);
74 } 74 }
75 75
76 void 76 void
77 files_init(void) 77 files_init(void)
78 { 78 {
240 } 240 }
241 241
242 if (toplevel) { 242 if (toplevel) {
243 directive_goteof(&linestartplace); 243 directive_goteof(&linestartplace);
244 } 244 }
245 free(buf); 245 dofree(buf);
246 } 246 }
247 247
248 //////////////////////////////////////////////////////////// 248 ////////////////////////////////////////////////////////////
249 // path search 249 // path search
250 250
306 file = mkfilename(id->name, name); 306 file = mkfilename(id->name, name);
307 fd = file_tryopen(file); 307 fd = file_tryopen(file);
308 if (fd >= 0) { 308 if (fd >= 0) {
309 pf = place_addfile(place, file, id->issystem); 309 pf = place_addfile(place, file, id->issystem);
310 file_read(pf, fd, file, false); 310 file_read(pf, fd, file, false);
311 free(file); 311 dofree(file);
312 close(fd); 312 close(fd);
313 return; 313 return;
314 } 314 }
315 free(file); 315 dofree(file);
316 } 316 }
317 complain(place, "Include file %s not found", name); 317 complain(place, "Include file %s not found", name);
318 complain_fail(); 318 complain_fail();
319 } 319 }
320 320