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
master
Benno Schulenberg 2016-02-11 08:50:11 +00:00
parent 6c82fd65ad
commit d4118efea5
2 changed files with 7 additions and 1 deletions

View File

@ -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.

View 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);