2930254effa3207ee279077f9689fac2c7387952
[mmh] / sbr / folder_free.c
1 /*
2 ** folder_free.c -- free a folder/message structure
3 **
4 ** This code is Copyright (c) 2002, by the authors of nmh.  See the
5 ** COPYRIGHT file in the root directory of the nmh distribution for
6 ** complete copyright information.
7 */
8
9 #include <h/mh.h>
10
11
12 void
13 folder_free(struct msgs *mp)
14 {
15         int i;
16
17         if (!mp)
18                 return;
19
20         if (mp->foldpath)
21                 free(mp->foldpath);
22
23         /* free the sequence names */
24         for (i = 0; mp->msgattrs[i]; i++)
25                 free(mp->msgattrs[i]);
26
27         free(mp->msgstats);  /* free message status area */
28         free(mp);  /* free main folder structure */
29 }