X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6c42153ad9362cc676ea66563bf400d7511b3b68..b3a909747d6166f820d2ac3c78cc5ad834d3b9b7:/sbr/folder_realloc.c?ds=sidebyside diff --git a/sbr/folder_realloc.c b/sbr/folder_realloc.c index f3d99ba7..e7c4bc44 100644 --- a/sbr/folder_realloc.c +++ b/sbr/folder_realloc.c @@ -10,6 +10,7 @@ */ #include +#include /* * Reallocate some of the space in the folder @@ -46,10 +47,7 @@ folder_realloc (struct msgs *mp, int lo, int hi) * status array. So we don't have to move anything and can * just realloc the message status array. */ - if (!(mp->msgstats = realloc (mp->msgstats, MSGSTATSIZE(mp, lo, hi)))) { - advise (NULL, "unable to reallocate message storage"); - return NULL; - } + mp->msgstats = mh_xrealloc (mp->msgstats, MSGSTATSIZE(mp, lo, hi)); } else { /* * We are changing the offset of the message status @@ -58,10 +56,7 @@ folder_realloc (struct msgs *mp, int lo, int hi) seqset_t *tmpstats; /* first allocate the new message status space */ - if (!(tmpstats = malloc (MSGSTATSIZE(mp, lo, hi)))) { - advise (NULL, "unable to reallocate message storage"); - return NULL; - } + tmpstats = mh_xmalloc (MSGSTATSIZE(mp, lo, hi)); /* then copy messages status array with shift */ if (mp->nummsg > 0) {