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) {
tmpstats[msgnum - lo] = mp->msgstats[msgnum - mp->lowoff];
}
}
- free(mp->msgstats);
+ mh_free0(&(mp->msgstats));
mp->msgstats = tmpstats;
}