]> diplodocus.org Git - nmh/blobdiff - sbr/folder_free.c
A bug fix and an enhancement to mhfixmsg based on patches
[nmh] / sbr / folder_free.c
index 1c1051defb6269c745ece51fa433b777e831a87f..7f87ccd4f406a2ff1e8bea13c6f0ba2797286c0b 100644 (file)
@@ -2,7 +2,9 @@
 /*
  * folder_free.c -- free a folder/message structure
  *
- * $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.
  */
 
 #include <h/mh.h>
@@ -23,6 +25,14 @@ folder_free (struct msgs *mp)
     for (i = 0; mp->msgattrs[i]; i++)
        free (mp->msgattrs[i]);
 
+    /* Close/free the sequence file if it is open */
+
+    if (mp->seqhandle)
+       lkfclosedata (mp->seqhandle, mp->seqname);
+
+    if (mp->seqname)
+       free (mp->seqname);
+
     free (mp->msgstats);       /* free message status area   */
     free (mp);                 /* free main folder structure */
 }