X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;ds=sidebyside;f=uip%2Fmhfree.c;h=38b830ec20908eba042b1517d954642ad17bed3a;hb=5dd6771b28c257af405d7248639ed0e3bcdce38b;hp=c43c5e92421e4210b93602abd778b18ca5f9c770;hpb=028324109b0e90a18d0b38c6c45a603a6c8732b5;p=mmh diff --git a/uip/mhfree.c b/uip/mhfree.c index c43c5e9..38b830e 100644 --- a/uip/mhfree.c +++ b/uip/mhfree.c @@ -3,8 +3,6 @@ * mhfree.c -- routines to free the data structures used to * -- represent MIME messages * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -15,7 +13,8 @@ #include #include -extern int errno; +/* The list of top-level contents to display */ +CT *cts = NULL; /* * prototypes @@ -24,6 +23,7 @@ void free_content (CT); void free_header (CT); void free_ctinfo (CT); void free_encoding (CT, int); +void freects_done (int); /* * static prototypes @@ -103,6 +103,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) @@ -281,3 +283,16 @@ free_encoding (CT ct, int toplevel) ct->c_ceopenfnx = NULL; } } + + +void +freects_done (int status) +{ + CT *ctp; + + if ((ctp = cts)) + for (; *ctp; ctp++) + free_content (*ctp); + + exit (status); +}