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-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5a1dd1f79cbbf4748a50b8330b19db4eadbea1b;p=neomutt 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 6f2af2fb3..9ddbe3f83 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);