* 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
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) {