- for (i = history_num - 1; i >= 0; i--)
- if (history[i].cleanup)
- history[i].cleanup(&history[i].u);
+ for (i = history_num - 1; i >= 0; i--) {
+ if (!history[i].cleanup)
+ continue;
+ if (!forced_cleanup) {
+ printf("Leak at %s:%u\n",
+ history[i].file, history[i].line);
+ status = 1;
+ }
+ history[i].cleanup(&history[i].u);
+ }