X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=alias.c;h=f5b685924442c0fcc9007901e7474ff8d87cd154;hb=49f1156410e9a037404101696d37b2c0d5c67564;hp=667dad25395d245bbd7157036d417b4773efa12a;hpb=ea912b20ba2b3b9dfdbbae758ad56263c9aa41b3;p=apps%2Fmadmutt.git diff --git a/alias.c b/alias.c index 667dad2..f5b6859 100644 --- a/alias.c +++ b/alias.c @@ -14,6 +14,8 @@ #include #include +#include + #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; @@ -254,7 +256,7 @@ retry_name: } } - new = mem_calloc (1, sizeof (ALIAS)); + new = p_new(ALIAS, 1); new->self = new; new->name = str_dup (buf); @@ -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); }