]> diplodocus.org Git - nmh/blobdiff - sbr/folder_free.c
Make sure to mark the sequence file as closed in the msgs struct.
[nmh] / sbr / folder_free.c
index f06bbf5ce44d3e202ec884bdd03f9bce1de2744e..7f87ccd4f406a2ff1e8bea13c6f0ba2797286c0b 100644 (file)
@@ -2,8 +2,6 @@
 /*
  * 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.
@@ -27,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 */
 }