From: Benno Schulenberg Date: Wed, 10 Feb 2016 12:32:43 +0000 (+0000) Subject: Plugging a sneaky memory leak. This fixes Savannah bug #47003 X-Git-Tag: v2.5.2~11 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d83bd7e3053a2e0eee7291cb30a2f2432bb07a69;p=nano.git Plugging a sneaky memory leak. This fixes Savannah bug #47003 reported and solved by Mike Frysinger. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5624 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 65a4411e..dc46d976 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 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. + * src/files.c (get_full_path): Plug a sneaky memory leak. This fixes + Savannah bug #47003 reported and solved by Mike Frysinger. 2016-02-09 Benno Schulenberg * src/files.c (stat_with_alloc, open_buffer, write_file): Check the diff --git a/src/files.c b/src/files.c index 52ec6349..e68e81c1 100644 --- a/src/files.c +++ b/src/files.c @@ -1504,10 +1504,10 @@ char *get_full_path(const char *origpath) * where we were before. We don't check for a chdir() * error, since we can do nothing if we get one. */ IGNORE_CALL_RESULT(chdir(d_here)); - - /* Free d_here, since we're done using it. */ - free(d_here); } + + /* Free d_here, since we're done using it. */ + free(d_here); } /* At this point, if path_only is FALSE and d_there isn't NULL,