diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2007-11-03 00:36:15 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2007-11-03 00:36:15 +0000 |
commit | ec960274575d160b2df051611097a9ba5e71335b (patch) | |
tree | e5e858c944b832c3025d5d53132376b43a03a807 /usr.bin/ssh | |
parent | a1b81cfe9b23442fbcab0767c193b74a8aaabc18 (diff) |
fix memory leak in process_cmdline(), patch from Jan.Pechanec AT Sun.COM;
ok dtucker@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index f4d7a03717d..535a864b726 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/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 @@ -945,6 +945,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); @@ -1044,6 +1047,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 */ |