X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffolder_read.c;h=011958f861d342ab1998d8af3d8d2456d4622515;hp=1c68d0d554dfee3372cc56d473910c7d215be5a1;hb=b3d32781d25365c2270210bc9ef7b645d83b8dbe;hpb=b78007de9802005825390bee71dfce2306b42519 diff --git a/sbr/folder_read.c b/sbr/folder_read.c index 1c68d0d..011958f 100644 --- a/sbr/folder_read.c +++ b/sbr/folder_read.c @@ -33,14 +33,14 @@ folder_read(char *name) struct dirent *dp; DIR *dd; - name = getcpy(toabsdir(name)); + name = mh_xstrdup(toabsdir(name)); if (!(dd = opendir(name))) { - free(name); + mh_free0(&name); return NULL; } if (stat(name, &st) == -1) { - free(name); + mh_free0(&name); closedir(dd); return NULL; } @@ -131,14 +131,6 @@ folder_read(char *name) mp->msgstats = mh_xcalloc(MSGSTATSIZE(mp, mp->lowoff, mp->hghoff), 1); /* - ** Clear all the flag bits for all the message - ** status entries we just allocated. - ** TODO: use memset() ? - */ - for (msgnum = mp->lowoff; msgnum <= mp->hghoff; msgnum++) - clear_msg_flags(mp, msgnum); - - /* ** Scan through the array of messages we've seen and ** setup the initial flags for those messages in the ** newly allocated mp->msgstats area. @@ -146,7 +138,7 @@ folder_read(char *name) for (msgnum = 0; msgnum < mp->nummsg; msgnum++) set_exists(mp, mi[msgnum]); - free(mi); /* We don't need this anymore */ + mh_free0(&mi); /* We don't need this anymore */ /* ** Read and initialize the sequence information.