drop mem_alloc and mem_free, use my own hand crafted optmized macros that
[apps/madmutt.git] / alias.c
diff --git a/alias.c b/alias.c
index 667dad2..8a6c892 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -14,6 +14,8 @@
 #include <string.h>
 #include <ctype.h>
 
+#include <lib-lib/mem.h>
+
 #include "lib/mem.h"
 #include "lib/intl.h"
 #include "lib/str.h"
@@ -73,7 +75,7 @@ static ADDRESS *mutt_expand_aliases_r (ADDRESS * a, LIST ** expn)
         }
 
         if (!i) {
-          u = mem_malloc (sizeof (LIST));
+          u = p_new(LIST, 1);
           u->data = str_dup (a->mailbox);
           u->next = *expn;
           *expn = u;
@@ -430,9 +432,9 @@ int mutt_alias_complete (char *s, size_t buflen)
       while (a) {
         if (a->name && (strstr (a->name, s) == a->name)) {
           if (!a_list)          /* init */
-            a_cur = a_list = (ALIAS *) mem_malloc (sizeof (ALIAS));
+            a_cur = a_list = p_new(ALIAS, 1);
           else {
-            a_cur->next = (ALIAS *) mem_malloc (sizeof (ALIAS));
+            a_cur->next = p_new(ALIAS, 1);
             a_cur = a_cur->next;
           }
           memcpy (a_cur, a, sizeof (ALIAS));
@@ -452,7 +454,7 @@ int mutt_alias_complete (char *s, size_t buflen)
   while (a_list) {
     a_cur = a_list;
     a_list = a_list->next;
-    mem_free (&a_cur);
+    p_delete(&a_cur);
   }
 
   /* remove any aliases marked for deletion */
@@ -730,6 +732,6 @@ new_aliases:
   }
 
   mutt_menuDestroy (&menu);
-  mem_free (&AliasTable);
+  p_delete(&AliasTable);
 
 }