drop mem_alloc and mem_free, use my own hand crafted optmized macros that
[apps/madmutt.git] / imap / browse.c
index fd9c473..73bfcbc 100644 (file)
@@ -17,6 +17,8 @@
 #include <stdlib.h>
 #include <ctype.h>
 
+#include <lib-lib/mem.h>
+
 #include "lib/mem.h"
 #include "lib/str.h"
 #include "lib/intl.h"
@@ -231,13 +233,13 @@ int imap_browse (char *path, struct browser_state *state)
   if (save_lsub)
     set_option (OPTIMAPCHECKSUBSCRIBED);
 
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return 0;
 
 fail:
   if (save_lsub)
     set_option (OPTIMAPCHECKSUBSCRIBED);
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return -1;
 }
 
@@ -284,11 +286,11 @@ int imap_mailbox_create (const char *folder)
 
   mutt_sleep (0);
 
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return 0;
 
 fail:
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return -1;
 }
 
@@ -329,11 +331,11 @@ int imap_mailbox_rename (const char *mailbox)
   mutt_message (_("Mailbox renamed."));
   mutt_sleep (0);
 
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return 0;
 
 fail:
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return -1;
 }
 
@@ -356,7 +358,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd,
   do {
     if (imap_parse_list_response (idata, &name, &noselect, &noinferiors,
                                   &idata->delim) != 0) {
-      mem_free (&mx.mbox);
+      p_delete(&mx.mbox);
       return -1;
     }
 
@@ -372,7 +374,7 @@ static int browse_add_list_result (IMAP_DATA * idata, const char *cmd,
   }
   while ((ascii_strncmp (idata->cmd.buf, idata->cmd.seq, SEQLEN) != 0));
 
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
   return 0;
 }
 
@@ -412,7 +414,7 @@ static void imap_add_folder (char delim, char *folder, int noselect,
    * than at scan, since it's so expensive to scan. But that's big changes
    * to browser.c */
   if (!((regexec (Mask.rx, relpath, 0, NULL, 0) == 0) ^ Mask.not)) {
-    mem_free (&mx.mbox);
+    p_delete(&mx.mbox);
     return;
   }
 
@@ -436,7 +438,7 @@ static void imap_add_folder (char delim, char *folder, int noselect,
   (state->entry)[state->entrylen].inferiors = !noinferiors;
   (state->entrylen)++;
 
-  mem_free (&mx.mbox);
+  p_delete(&mx.mbox);
 }
 
 static int compare_names (struct folder_file *a, struct folder_file *b)