summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-11-23 14:44:44 +0000
committerColin Watson <cjwatson@debian.org>2008-11-23 14:44:44 +0000
commiteb839492d5500cf0338661197702239cfdf7196c (patch)
tree8c8471b9f81bb8d9286eac38e7f21cbdd4e17d2c /readconf.c
parentf063add71b66011cca8c313fe0c681b0f0e1b97f (diff)
Fix double-free when failing to parse a forwarding specification given
using ~C (closes: #505330; forwarded upstream as https://bugzilla.mindrot.org/show_bug.cgi?id=1539).
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 7ad5a8e18..043673ced 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1334,9 +1334,13 @@ parse_forward(Forward *fwd, const char *fwdspec)
1334 return (i); 1334 return (i);
1335 1335
1336 fail_free: 1336 fail_free:
1337 if (fwd->connect_host != NULL) 1337 if (fwd->connect_host != NULL) {
1338 xfree(fwd->connect_host); 1338 xfree(fwd->connect_host);
1339 if (fwd->listen_host != NULL) 1339 fwd->connect_host = NULL;
1340 }
1341 if (fwd->listen_host != NULL) {
1340 xfree(fwd->listen_host); 1342 xfree(fwd->listen_host);
1343 fwd->connect_host = NULL;
1344 }
1341 return (0); 1345 return (0);
1342} 1346}