From 4f39381db9459e960e4c446bf93efea9f0ed2dbb Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Mon, 8 Oct 2012 09:25:11 +0200 Subject: [PATCH] stuff some leaks --- options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/options.c b/options.c index 07fb702..bb95790 100644 --- a/options.c +++ b/options.c @@ -50,6 +50,7 @@ void free_ini(void) free(sections[i].entries[j].value); } free(sections[i].entries); + free(sections[i].name); } free(sections); } @@ -204,7 +205,7 @@ int load_ini_file(FILE *fp) if (current_section) free(current_section); current_section = (strdup(start+1)); - new_section(strdup(current_section)); + new_section(current_section); continue; } @@ -246,6 +247,8 @@ int load_ini_file(FILE *fp) add_entry(current_section, key, value); } + if (current_section) + free(current_section); return 0; } /* vim: set ts=8 sw=8 tw=0: */