summaryrefslogtreecommitdiffstats
path: root/cfg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-08-09 08:34:17 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-08-09 08:34:17 +0000
commitb3107d26dfdabaeaffa558db40e69962e7c697f6 (patch)
tree5c3cf37cda4a4ea1ae07754581c87784e9d89954 /cfg.c
parent05f1680efaae84222a88f8fdeed34e72a5085b42 (diff)
Don't leak in the (rare) case of an invalid command at the end of a file not
terminated by a \n.
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cfg.c b/cfg.c
index 6320641e..75390165 100644
--- a/cfg.c
+++ b/cfg.c
@@ -112,6 +112,8 @@ load_cfg(const char *path, char **cause)
return (0);
error:
+ if (line != NULL)
+ xfree(line);
fclose(f);
xasprintf(&ptr, "%s: %s at line %u", path, *cause, n);