summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-04-25 13:36:01 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-04-25 13:36:01 +0200
commitc7383edd721867a34313690831463c6ef280e14e (patch)
treeb75fc7532f0a0a0e30ae9e3f69854bd8872ae672 /src
parentf39efad8df5327babb6b6141a03ce06e49b4cbdf (diff)
downloadfastd-c7383edd721867a34313690831463c6ef280e14e.tar
fastd-c7383edd721867a34313690831463c6ef280e14e.zip
Fix memory leak in config parser
Diffstat (limited to 'src')
-rw-r--r--src/config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index b042f95..4fa3988 100644
--- a/src/config.c
+++ b/src/config.c
@@ -321,14 +321,17 @@ bool fastd_config_add_log_file(fastd_context_t *ctx, fastd_config_t *conf, const
if(chdir(oldcwd))
pr_error(ctx, "can't chdir to `%s': %s", oldcwd, strerror(errno));
+
+ free(logdir);
}
else {
pr_error(ctx, "change from directory `%s' to `%s' failed: %s", oldcwd, dir, strerror(errno));
}
-
+ free(oldcwd);
free(name2);
free(name3);
+
return true;
}