From d4118efea505b0852d267d6d98ac22a641d5aaf0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 11 Feb 2016 08:50:11 +0000 Subject: [PATCH] Going to the next item in the list before freeing the current one. This fixes Savannah bug #46796. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5631 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/text.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 941417ad..7ff6b107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-02-11 Benno Schulenberg + * 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 * src/text.c (discard_until): Prevent a chain of editing actions from continuing after a discard. This fixes Savannah bug #47104. diff --git a/src/text.c b/src/text.c index b1cff482..6cec9430 100644 --- a/src/text.c +++ b/src/text.c @@ -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);