From: Phil Pennock Date: Thu, 12 Jan 2006 19:09:28 +0000 (+0000) Subject: Update MyVars to the next entry when deleting the head of the list, X-Git-Tag: mutt-1-5-12-rel~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f684717dd3db076c4c34b440d844a6d53347f66;p=mutt Update MyVars to the next entry when deleting the head of the list, instead of leaving it pointing to a freed entry. --- diff --git a/init.c b/init.c index 6f2af2fb..9ddbe3f8 100644 --- a/init.c +++ b/init.c @@ -3054,7 +3054,10 @@ static void myvar_del (const char* var) { if (!mutt_strcmp (cur->name, var)) { - prev->next = cur->next; + if (cur == MyVars) + MyVars = cur->next; + else + prev->next = cur->next; FREE (&cur->name); FREE (&cur->value); FREE (&cur);