X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhfree.c;h=418e5c920a90ff205d86430036e61e41fa66e7ce;hb=045101c0a79f43fe566422622f154d5cc0141d8a;hp=57518015f9cdb9816c56d0a259b5bb6f9d15a373;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/uip/mhfree.c b/uip/mhfree.c index 5751801..418e5c9 100644 --- a/uip/mhfree.c +++ b/uip/mhfree.c @@ -15,7 +15,8 @@ #include #include -extern int errno; +/* The list of top-level contents to display */ +CT *cts = NULL; /* * prototypes @@ -24,6 +25,7 @@ void free_content (CT); void free_header (CT); void free_ctinfo (CT); void free_encoding (CT, int); +int freects_done (int); /* * static prototypes @@ -103,6 +105,8 @@ free_content (CT ct) free (ct->c_id); if (ct->c_descr) free (ct->c_descr); + if (ct->c_dispo) + free (ct->c_dispo); if (ct->c_file) { if (ct->c_unlink) @@ -271,6 +275,7 @@ free_encoding (CT ct, int toplevel) if (ce->ce_unlink) unlink (ce->ce_file); free (ce->ce_file); + ce->ce_file = NULL; } if (toplevel) { @@ -280,3 +285,17 @@ free_encoding (CT ct, int toplevel) ct->c_ceopenfnx = NULL; } } + + +int +freects_done (int status) +{ + CT *ctp; + + if ((ctp = cts)) + for (; *ctp; ctp++) + free_content (*ctp); + + exit (status); + return 1; /* dead code to satisfy the compiler */ +}