summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2013-12-26 13:53:30 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2013-12-26 13:53:30 +0100
commit85e14096042f1484175f2f396ea76ec4948bf467 (patch)
tree96f469c70024b067c6b4fb7a1fd21acb19bdf021
parent8dd79bb90e2ccbcd71eeab9c203e563f0a547050 (diff)
Fix memory leaks in libconf.
-rw-r--r--src/lib/conf/conf_load.c4
-rw-r--r--src/lib/conf/conf_main.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/conf/conf_load.c b/src/lib/conf/conf_load.c
index f41c1e7..bd6c82a 100644
--- a/src/lib/conf/conf_load.c
+++ b/src/lib/conf/conf_load.c
@@ -37,6 +37,8 @@ conf_load_line_parse(Conf *conf,
37 if (!buf) 37 if (!buf)
38 { 38 {
39 ERR("Failed to allocate string buffer"); 39 ERR("Failed to allocate string buffer");
40 free(split[0]);
41 free(split);
40 return; 42 return;
41 } 43 }
42 44
@@ -50,6 +52,8 @@ conf_load_line_parse(Conf *conf,
50 52
51 eina_hash_add(conf->variables, variable, strdup(value)); 53 eina_hash_add(conf->variables, variable, strdup(value));
52 54
55 free(split[0]);
56 free(split);
53 free(variable); 57 free(variable);
54 free(value); 58 free(value);
55 eina_strbuf_free(buf); 59 eina_strbuf_free(buf);
diff --git a/src/lib/conf/conf_main.c b/src/lib/conf/conf_main.c
index c28e886..b3c7899 100644
--- a/src/lib/conf/conf_main.c
+++ b/src/lib/conf/conf_main.c
@@ -33,7 +33,7 @@ conf_free(Conf *conf)
33 free((char *)conf->file); 33 free((char *)conf->file);
34 conf->file = NULL; 34 conf->file = NULL;
35 } 35 }
36 36 eina_hash_free(conf->variables);
37 free(conf); 37 free(conf);
38} 38}
39 39