]> git.wh0rd.org Git - nano.git/commitdiff
Plugging a small memory leak.
authorBenno Schulenberg <bensberg@justemail.net>
Fri, 10 Jul 2015 15:54:06 +0000 (15:54 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Fri, 10 Jul 2015 15:54:06 +0000 (15:54 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5287 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/files.c
src/nano.c
src/nano.h

index efcca7c40afc60908cb3f9f811917d584d242d5a..faa7481e2df0ffc8cf6d8332a2e86a01902180f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2015-07-10  Benno Schulenberg  <bensberg@justemail.net>
+       * src/nano.c (delete_opennode): Plug a small memory leak.
+
 2015-07-06  Benno Schulenberg  <bensberg@justemail.net>
        * src/global.c (add_to_sclist), src/help.c (help_init), src/nano.h,
        src/rcfile.c (parse_binding): When defining the toggles, give each
index fb47d944483089cca56909a33f2f579b865b94f8..ca8848ff762a88f58a309186fe3b8c3d7a398d56 100644 (file)
@@ -224,7 +224,7 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
        return -1;
     }
 
-    openfile->lock_filename = lockfilename;
+    openfile->lock_filename = (char *) lockfilename;
 
     return 1;
 }
index e87caa87011c99b31fd15faa2fe6aeb5a092cdd9..7fc8a429a94e59e4d6bba434c43011a2bb6c752c 100644 (file)
@@ -569,6 +569,7 @@ void delete_opennode(openfilestruct *fileptr)
     free_filestruct(fileptr->fileage);
 #ifndef NANO_TINY
     free(fileptr->current_stat);
+    free(fileptr->lock_filename);
 #endif
     free(fileptr);
 }
index db7be93bd76a0b04d95134473b28ab1970706a0c..d3b98d87f73f12210cfa5220f64341200c7823d8 100644 (file)
@@ -397,7 +397,7 @@ typedef struct openfilestruct {
     undo *current_undo;
        /* The current (i.e. next) level of undo. */
     undo_type last_action;
-    const char *lock_filename;
+    char *lock_filename;
        /* The path of the lockfile, if we created one. */
 #endif
 #ifndef DISABLE_COLOR