From c8b6569da944a102a0d613c72b91b9ee20fcaa9e Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 15 Aug 2019 19:39:27 +0100 Subject: imv_load_config: Fix memory leak --- src/imv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/imv.c b/src/imv.c index 5c6b73b..2d948fa 100644 --- a/src/imv.c +++ b/src/imv.c @@ -1411,16 +1411,18 @@ bool imv_load_config(struct imv *imv) return true; } + bool result = true; + const int err = ini_parse(path, handle_ini_value, imv); if (err == -1) { imv_log(IMV_ERROR, "Unable to open config file: %s\n", path); - return false; + result = false; } else if (err > 0) { imv_log(IMV_ERROR, "Error in config file: %s:%d\n", path, err); - return false; + result = false; } free(path); - return true; + return result; } static void command_quit(struct list *args, const char *argstr, void *data) -- cgit v1.2.3