]> git.wh0rd.org Git - nano.git/commitdiff
Going to the next item in the list before freeing the current one.
authorBenno Schulenberg <bensberg@justemail.net>
Thu, 11 Feb 2016 08:50:11 +0000 (08:50 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Thu, 11 Feb 2016 08:50:11 +0000 (08:50 +0000)
This fixes Savannah bug #46796.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5631 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/text.c

index 941417ad0833f8f3b10ff3b5fb53b97381b0359e..7ff6b107998ab39a0e4680a240b405393f36dc06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-11  Benno Schulenberg  <bensberg@justemail.net>
+       * src/text.c (do_linter): Go to the next item in the list before
+       freeing the current one.  This fixes Savannah bug #46796.
+
 2016-02-10  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (discard_until): Prevent a chain of editing actions from
        continuing after a discard.  This fixes Savannah bug #47104.
index b1cff4822df6d53eb2baa026a702ec7df35679b6..6cec943021062bde26006d55f328fe5e26b32ae1 100644 (file)
@@ -3198,7 +3198,9 @@ void do_linter(void)
 #ifndef NANO_TINY
   free_lints_and_return:
 #endif
-    for (tmplint = lints; tmplint != NULL; tmplint = tmplint->next) {
+    for (curlint = lints; curlint != NULL;) {
+       tmplint = curlint;
+       curlint = curlint->next;
        free(tmplint->msg);
        free(tmplint->filename);
        free(tmplint);