]> granicus.if.org Git - neomutt/commitdiff
Update MyVars to the next entry when deleting the head of the list,
authorPhil Pennock <mutt-dev@spodhuis.demon.nl>
Thu, 12 Jan 2006 19:09:28 +0000 (19:09 +0000)
committerPhil Pennock <mutt-dev@spodhuis.demon.nl>
Thu, 12 Jan 2006 19:09:28 +0000 (19:09 +0000)
instead of leaving it pointing to a freed entry.

init.c

diff --git a/init.c b/init.c
index 6f2af2fb37e22bec34932c9e68b81ec0b559b96f..9ddbe3f83d99e097e276756f988fe2b0f51cfc90 100644 (file)
--- 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);