]> diplodocus.org Git - nmh/blobdiff - uip/mhfree.c
Migrated show_content_aux2() to argsplit().
[nmh] / uip / mhfree.c
index 38b830ec20908eba042b1517d954642ad17bed3a..29756876fdd11637a6cbafccd03d1a7191a05123 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 #include <h/mh.h>
-#include <errno.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 
@@ -19,7 +18,6 @@ CT *cts = NULL;
 /*
  * prototypes
  */
-void free_content (CT);
 void free_header (CT);
 void free_ctinfo (CT);
 void free_encoding (CT, int);
@@ -108,7 +106,7 @@ free_content (CT ct)
 
     if (ct->c_file) {
        if (ct->c_unlink)
-           unlink (ct->c_file);
+           (void) m_unlink (ct->c_file);
        free (ct->c_file);
     }
     if (ct->c_fp)
@@ -205,6 +203,8 @@ free_multi (CT ct)
        free (m->mp_start);
     if (m->mp_stop)
        free (m->mp_stop);
+    free (m->mp_content_before);
+    free (m->mp_content_after);
        
     for (part = m->mp_parts; part; part = next) {
        next = part->mp_next;
@@ -245,6 +245,8 @@ free_external (CT ct)
     free_content (e->eb_content);
     if (e->eb_body)
        free (e->eb_body);
+    if (e->eb_url)
+       free (e->eb_url);
 
     free ((char *) e);
     ct->c_ctparams = NULL;
@@ -259,10 +261,7 @@ free_external (CT ct)
 void
 free_encoding (CT ct, int toplevel)
 {
-    CE ce;
-
-    if (!(ce = ct->c_cefile))
-       return;
+    CE ce = &ct->c_cefile;
 
     if (ce->ce_fp) {
        fclose (ce->ce_fp);
@@ -271,15 +270,12 @@ free_encoding (CT ct, int toplevel)
 
     if (ce->ce_file) {
        if (ce->ce_unlink)
-           unlink (ce->ce_file);
+           (void) m_unlink (ce->ce_file);
        free (ce->ce_file);
        ce->ce_file = NULL;
     }
 
-    if (toplevel) {
-       free ((char *) ce);
-       ct->c_cefile = NULL;
-    } else {
+    if (! toplevel) {
        ct->c_ceopenfnx = NULL;
     }
 }