exit mem_realloc, enters p_realloc/xrealloc.
[apps/madmutt.git] / imap / browse.c
index 73bfcbc..52dcc79 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <lib-lib/mem.h>
 
-#include "lib/mem.h"
 #include "lib/str.h"
 #include "lib/intl.h"
 #include "lib/debug.h"
@@ -394,11 +393,9 @@ static void imap_add_folder (char delim, char *folder, int noselect,
   imap_unmunge_mbox_name (folder);
 
   if (state->entrylen + 1 == state->entrymax) {
-    mem_realloc (&state->entry,
-                  sizeof (struct folder_file) * (state->entrymax += 256));
-    memset (state->entry + state->entrylen, 0,
-            (sizeof (struct folder_file) *
-             (state->entrymax - state->entrylen)));
+    p_realloc(&state->entry, state->entrymax += 256);
+    p_clear(state->entry + state->entrylen,
+            state->entrymax - state->entrylen);
   }
 
   /* render superiors as unix-standard ".." */