summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-12-09 14:12:05 +1100
committerDamien Miller <djm@mindrot.org>2008-12-09 14:12:05 +1100
commit0d772d9d11ceedd9432383019a75859813149673 (patch)
tree67a0d7fe3ad1f90e6a56243c82442332ebf0fd7b /readconf.c
parent1be2cc44961177897c3380ed7a8ec3641d5fd8ad (diff)
downloadopenssh-git-0d772d9d11ceedd9432383019a75859813149673.tar.gz
- djm@cvs.openbsd.org 2008/12/09 02:58:16
[readconf.c] don't leave junk (free'd) pointers around in Forward *fwd argument on failure; avoids double-free in ~C -L handler when given an invalid forwarding specification; bz#1539 report from adejong AT debian.org via Colin Watson; ok markus@ dtucker@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/readconf.c b/readconf.c
index d1ffd84a..ab89e0c0 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.172 2008/11/04 19:18:00 stevesk Exp $ */
+/* $OpenBSD: readconf.c,v 1.173 2008/12/09 02:58:16 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1293,9 +1293,13 @@ parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd)
return (i);
fail_free:
- if (fwd->connect_host != NULL)
+ if (fwd->connect_host != NULL) {
xfree(fwd->connect_host);
- if (fwd->listen_host != NULL)
+ fwd->connect_host = NULL;
+ }
+ if (fwd->listen_host != NULL) {
xfree(fwd->listen_host);
+ fwd->listen_host = NULL;
+ }
return (0);
}