]> git.wh0rd.org Git - nano.git/commitdiff
Freeing the position-history records that are dropped.
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 10 Feb 2016 20:29:23 +0000 (20:29 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Wed, 10 Feb 2016 20:29:23 +0000 (20:29 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5629 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c

index 332fcba69c5d74f81fdf545b478155fc0ad4766b..41a587100819369c5164061e156755f88237cb09 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
        * AUTHORS, THANKS: Remove SVN Id tags and a duplication.
        * src/winio.c (get_kbinput), src/nano.c (main): Switch the cursor on
        in the right place: in the central input routine.
+       * src/files.c (load_poshistory): Free any records that are dropped.
 
 2016-02-09  Benno Schulenberg  <bensberg@justemail.net>
        * src/files.c (stat_with_alloc, open_buffer, write_file): Check the
index e68e81c13e31a3ee14e074035de52584476e47f1..c16b9272fe830d2e532af62a870c0f95fafecde4 100644 (file)
@@ -3323,8 +3323,14 @@ void load_poshistory(void)
            record_ptr = newrecord;
 
            /* Impose a limit, so the file will not grow indefinitely. */
-           if (++count > 200)
+           if (++count > 200) {
+               poshiststruct *drop_record = position_history;
+
                position_history = position_history->next;
+
+               free(drop_record->filename);
+               free(drop_record);
+           }
        }
        fclose(hist);
        free(line);