aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-09 17:53:50 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-09 17:53:50 +0000
commit1297c39a31c10fb5e168518709b4e1ae4d73ac33 (patch)
tree5e6ec83d1dc7538c45e1689be75c7d9eeb5216e4
parent4c944910fabeb2084c93a42425aa358cb1ccd294 (diff)
downloadrtmux-1297c39a31c10fb5e168518709b4e1ae4d73ac33.tar.gz
rtmux-1297c39a31c10fb5e168518709b4e1ae4d73ac33.tar.bz2
rtmux-1297c39a31c10fb5e168518709b4e1ae4d73ac33.zip
Sync OpenBSD patchset 233:
Don't leak in the (rare) case of an invalid command at the end of a file not terminated by a \n.
-rw-r--r--cfg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cfg.c b/cfg.c
index c50c5cd9..d1bfafb8 100644
--- a/cfg.c
+++ b/cfg.c
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.19 2009-07-30 21:07:23 tcunha Exp $ */
+/* $Id: cfg.c,v 1.20 2009-08-09 17:53:50 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);