diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2008-11-04 19:18:01 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2008-11-04 19:18:01 +0000 |
commit | 26f5a35cbcb98ebb245a0ab91a6520175e28bf35 (patch) | |
tree | f964e05dae21fb03b881f7e001885ea42c5e3c76 /usr.bin/ssh | |
parent | 2efc10a936ad0a7c9b0388952c21302a7b82cb11 (diff) |
because parse_forward() is now used to parse all forward types (DLR),
and it malloc's space for host variables, we don't need to malloc
here. fixes small memory leaks.
previously dynamic forwards were not parsed in parse_forward() and
space was not malloc'd in that case.
ok djm@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/readconf.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 911e5205af8..2f7ff09d05f 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.171 2008/11/04 08:22:13 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.172 2008/11/04 19:18:00 stevesk Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -251,10 +251,9 @@ add_local_forward(Options *options, const Forward *newfwd) fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION); fwd = &options->local_forwards[options->num_local_forwards++]; - fwd->listen_host = (newfwd->listen_host == NULL) ? - NULL : xstrdup(newfwd->listen_host); + fwd->listen_host = newfwd->listen_host; fwd->listen_port = newfwd->listen_port; - fwd->connect_host = xstrdup(newfwd->connect_host); + fwd->connect_host = newfwd->connect_host; fwd->connect_port = newfwd->connect_port; } @@ -272,10 +271,9 @@ add_remote_forward(Options *options, const Forward *newfwd) SSH_MAX_FORWARDS_PER_DIRECTION); fwd = &options->remote_forwards[options->num_remote_forwards++]; - fwd->listen_host = (newfwd->listen_host == NULL) ? - NULL : xstrdup(newfwd->listen_host); + fwd->listen_host = newfwd->listen_host; fwd->listen_port = newfwd->listen_port; - fwd->connect_host = xstrdup(newfwd->connect_host); + fwd->connect_host = newfwd->connect_host; fwd->connect_port = newfwd->connect_port; } |