diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-08-15 19:39:27 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-08-15 19:39:27 +0100 |
commit | c8b6569da944a102a0d613c72b91b9ee20fcaa9e (patch) | |
tree | d4d12886e8e18ff6d4badf673cdcd52a42dcfde0 | |
parent | c7e391d65c14c484ed4c4b34cad0fa9e3f06aa55 (diff) | |
download | imv-c8b6569da944a102a0d613c72b91b9ee20fcaa9e.tar.gz |
imv_load_config: Fix memory leak
-rw-r--r-- | src/imv.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |