nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit d4118efea505b0852d267d6d98ac22a641d5aaf0
parent 6c82fd65ad04113a1b4af26b0722ab512b64916f
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Thu, 11 Feb 2016 08:50:11 +0000

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

Diffstat:
MChangeLog | 4++++
Msrc/text.c | 4+++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 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. diff --git 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);