X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=curs_main.c;h=82f8402ee476a2d03b67fd3dca7bd5cbb924623e;hp=02780692da9d79a740b829c8d2655c9c94ad2e64;hb=49f1156410e9a037404101696d37b2c0d5c67564;hpb=1f2995420ee1612199ab8af9909159a2a8afbdab diff --git a/curs_main.c b/curs_main.c index 0278069..82f8402 100644 --- a/curs_main.c +++ b/curs_main.c @@ -14,6 +14,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "mutt_curses.h" #include "mx.h" @@ -298,9 +300,7 @@ static void update_index (MUTTMENU * menu, CONTEXT * ctx, int check, /* save the list of new messages */ if (oldcount && check != M_REOPENED && ((Sort & SORT_MASK) == SORT_THREADS)) { - save_new = - (HEADER **) mem_malloc (sizeof (HEADER *) * - (Context->msgcount - oldcount)); + save_new = p_new(HEADER*, Context->msgcount - oldcount); for (j = oldcount; j < Context->msgcount; j++) save_new[j - oldcount] = Context->hdrs[j]; } @@ -332,7 +332,7 @@ static void update_index (MUTTMENU * menu, CONTEXT * ctx, int check, mutt_uncollapse_thread (Context, h); } } - mem_free (&save_new); + p_delete(&save_new); mutt_set_virtual (Context); } } @@ -386,7 +386,7 @@ struct mapping_t IndexHelp[] = { {N_("Reply"), OP_REPLY}, {N_("Group"), OP_GROUP_REPLY}, {N_("Help"), OP_HELP}, - {NULL} + {NULL, OP_NULL} }; #ifdef USE_NNTP @@ -399,7 +399,7 @@ struct mapping_t IndexNewsHelp[] = { {N_("Followup"), OP_FOLLOWUP}, {N_("Catchup"), OP_CATCHUP}, {N_("Help"), OP_HELP}, - {NULL} + {NULL, OP_NULL} }; #endif @@ -484,7 +484,7 @@ int mutt_index_menu (void) if ((check = mx_check_mailbox (Context, &index_hint, 0)) < 0) { if (!Context->path) { /* fatal error occurred */ - mem_free (&Context); + p_delete(&Context); menu->redraw = REDRAW_FULL; } set_option (OPTSEARCHINVALID); @@ -966,7 +966,7 @@ int mutt_index_menu (void) snprintf (buf, sizeof (buf), "~A"); unset_option (OPTHIDEREAD); } - mem_free (&Context->pattern); + p_delete(&Context->pattern); Context->pattern = str_dup (buf); } if ((op == OP_TOGGLE_READ && mutt_pattern_func (M_LIMIT, NULL) == 0) || @@ -1154,7 +1154,7 @@ int mutt_index_menu (void) /* check for a fatal error, or all messages deleted */ if (!Context->path) - mem_free (&Context); + p_delete(&Context); /* if we were in the pager, redisplay the message */ if (menu->menu == MENU_PAGER) { @@ -1257,7 +1257,7 @@ int mutt_index_menu (void) menu->redraw = REDRAW_INDEX | REDRAW_STATUS; break; } - mem_free (&Context); + p_delete(&Context); } mutt_sleep (0); @@ -1340,7 +1340,7 @@ int mutt_index_menu (void) { if (Context) { mx_fastclose_mailbox (Context); - mem_free (&Context); + p_delete(&Context); } done = 1; }