X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffolder_realloc.c;h=64a66409b40dc253fd5e58be44a99c56337039df;hp=47b9281ee92205ed9a4d31cb78e079a74522f74d;hb=88b2142594d5ea1e8385dae5eca81eed1018c555;hpb=cf1205b5cbea2f0cd6ea710ec16c637df85b647c diff --git a/sbr/folder_realloc.c b/sbr/folder_realloc.c index 47b9281..64a6640 100644 --- a/sbr/folder_realloc.c +++ b/sbr/folder_realloc.c @@ -54,7 +54,7 @@ folder_realloc(struct msgs *mp, int lo, int hi) seqset_t *tmpstats; /* first allocate the new message status space */ - tmpstats = mh_xmalloc(MSGSTATSIZE(mp, lo, hi)); + tmpstats = mh_xcalloc(MSGSTATSIZE(mp, lo, hi), 1); /* then copy messages status array with shift */ if (mp->nummsg > 0) { @@ -62,7 +62,7 @@ folder_realloc(struct msgs *mp, int lo, int hi) tmpstats[msgnum - lo] = mp->msgstats[msgnum - mp->lowoff]; } } - free(mp->msgstats); + mh_free0(&(mp->msgstats)); mp->msgstats = tmpstats; }