Commit 68ab4b84 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Plugging another memory leak.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5600 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 4 additions and 1 deletion
+4 -1
......@@ -4,6 +4,7 @@
* src/nano.c (main): Check position history only when 'positionlog'
is set. This fixes a bug unconsciously reported by Mike Frysinger.
* src/files.c (do_lockfile): Plug a couple of memory leaks.
* src/files.c (update_poshistory): Plug another memory leak.
2016-01-26 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (update_poshistory): Do not add directories to the
......
......@@ -3205,8 +3205,10 @@ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos)
poshiststruct *posptr, *theone, *posprev = NULL;
char *fullpath = get_full_path(filename);
if (fullpath == NULL || fullpath[strlen(fullpath) - 1] == '/')
if (fullpath == NULL || fullpath[strlen(fullpath) - 1] == '/') {
free(fullpath);
return;
}
/* Look for a matching filename in the list. */
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment