X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Ffolder_realloc.c;h=e7c4bc442bb6955da611d1c99fe72b3d84f6d392;hb=ac33b2e9c3632537b93fc4755a925c682d1eb82e;hp=f3d99ba7c38bc6650c4767bbb883692452c086b0;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/sbr/folder_realloc.c b/sbr/folder_realloc.c index f3d99ba..e7c4bc4 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) {