X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=color.c;h=ffc04db2fd57a1130ee314301732968f9c30a569;hp=5484bba0c05260eddeebec8349c5a6caebcdb2ff;hb=8e037c67a88cb4680c4391134c578e3b55a80f8a;hpb=c25bc063f35aaad6938c2022dae7a283346c2769 diff --git a/color.c b/color.c index 5484bba..ffc04db 100644 --- a/color.c +++ b/color.c @@ -11,6 +11,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "buffer.h" #include "ascii.h" @@ -125,14 +127,14 @@ static void mutt_free_color_line (COLOR_LINE ** l, int free_colors) regfree (&tmp->rx); mutt_pattern_free (&tmp->color_pattern); - mem_free (&tmp->pattern); - mem_free (l); + p_delete(&tmp->pattern); + p_delete(l); } void ci_start_color (void) { memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX); - ColorQuote = (int *) mem_malloc (COLOR_QUOTE_INIT * sizeof (int)); + ColorQuote = p_new(int, COLOR_QUOTE_INIT); memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT); ColorQuoteSize = COLOR_QUOTE_INIT; ColorQuoteUsed = 0; @@ -225,7 +227,7 @@ int mutt_alloc_color (int fg, int bg) i++; } - p = (COLOR_LIST *) mem_malloc (sizeof (COLOR_LIST)); + p = p_new(COLOR_LIST, 1); p->next = ColorList; ColorList = p; @@ -269,14 +271,14 @@ void mutt_free_color (int fg, int bg) if (p == ColorList) { ColorList = ColorList->next; - mem_free (&p); + p_delete(&p); return; } q = ColorList; while (q) { if (q->next == p) { q->next = p->next; - mem_free (&p); + p_delete(&p); return; } q = q->next;