summaryrefslogtreecommitdiffstats
path: root/clientloop.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-12-02 23:12:30 +1100
committerDarren Tucker <dtucker@zip.com.au>2007-12-02 23:12:30 +1100
commit23ae8ca9487a69533e39e3da1f63b88f5bee5629 (patch)
treee10e855911b4bc099c5debc946b8143fed684596 /clientloop.c
parent63b31cb9437185dff9574f0245e6953bb7651759 (diff)
- djm@cvs.openbsd.org 2007/11/03 00:36:14
[clientloop.c] fix memory leak in process_cmdline(), patch from Jan.Pechanec AT Sun.COM; ok dtucker@
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/clientloop.c b/clientloop.c
index 7a61cb74..ba53de48 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.182 2007/09/04 03:21:03 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.183 2007/11/03 00:36:14 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -953,6 +953,9 @@ process_cmdline(void)
u_short cancel_port;
Forward fwd;
+ bzero(&fwd, sizeof(fwd));
+ fwd.listen_host = fwd.connect_host = NULL;
+
leave_raw_mode();
handler = signal(SIGINT, SIG_IGN);
cmd = s = read_passphrase("\r\nssh> ", RP_ECHO);
@@ -1052,6 +1055,10 @@ out:
enter_raw_mode();
if (cmd)
xfree(cmd);
+ if (fwd.listen_host != NULL)
+ xfree(fwd.listen_host);
+ if (fwd.connect_host != NULL)
+ xfree(fwd.connect_host);
}
/* process the characters one by one */