summaryrefslogtreecommitdiffstats
path: root/cfg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-03-21 16:54:37 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-03-21 16:54:37 +0000
commit51ac2a3202d55c439976ecce49229e35865c7ebd (patch)
tree554f1705c19c6612162b0c4f0bb4ad6cf05c5cc7 /cfg.c
parent48291f0eeb9c376f821c746ca1ab6b88fcb62db2 (diff)
Fix a couple of memory leaks, from Romain Francoise.
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cfg.c b/cfg.c
index f9ad300f..aa2ceea4 100644
--- a/cfg.c
+++ b/cfg.c
@@ -131,8 +131,10 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
buf = copy;
while (isspace((u_char)*buf))
buf++;
- if (*buf == '\0')
+ if (*buf == '\0') {
+ free(copy);
continue;
+ }
if (cmd_string_parse(buf, &cmdlist, &cause) != 0) {
free(copy);