+2015-07-22 Mike Frysinger <vapier@gentoo.org>
+ * src/files.c (check_dotnano), src/global.c (thanks_for_all_the_fish),
+ src/rcfile.c (parse_binding): Plug a few memory leaks.
+
2015-07-19 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (main): Accept again a +LINE argument for each file
given on the command line. This fixes Savannah bug #45576.
* successfully created, and return 0 otherwise. */
int check_dotnano(void)
{
+ int ret = 1;
struct stat dirstat;
char *nanodir = construct_filename("/.nano");
history_error(N_("Unable to create directory %s: %s\n"
"It is required for saving/loading search history or cursor positions.\n"),
nanodir, strerror(errno));
- return 0;
+ ret = 0;
}
} else if (!S_ISDIR(dirstat.st_mode)) {
history_error(N_("Path %s is not a directory and needs to be.\n"
"Nano will be unable to load or save search history or cursor positions.\n"),
nanodir);
- return 0;
+ ret = 0;
}
- return 1;
+
+ free(nanodir);
+ return ret;
}
/* Load the search and replace histories from ~/.nano/search_history. */
syntaxtype *bill = syntaxes;
free(syntaxes->desc);
+ free(syntaxes->linter);
+ free(syntaxes->formatter);
while (syntaxes->extensions != NULL) {
regexlisttype *bob = syntaxes->extensions;
syntaxes->extensions = bob->next;
/* Add the new shortcut at the start of the list. */
newsc->next = sclist;
sclist = newsc;
- }
+ } else
+ free(keycopy);
}