aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-15 19:39:27 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-15 19:39:27 +0100
commitc8b6569da944a102a0d613c72b91b9ee20fcaa9e (patch)
treed4d12886e8e18ff6d4badf673cdcd52a42dcfde0
parentc7e391d65c14c484ed4c4b34cad0fa9e3f06aa55 (diff)
downloadimv-c8b6569da944a102a0d613c72b91b9ee20fcaa9e.tar.gz
imv_load_config: Fix memory leak
-rw-r--r--src/imv.c8
1 files changed, 5 insertions, 3 deletions
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)