summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2008-11-05 16:30:06 +1100
committerDamien Miller <djm@mindrot.org>2008-11-05 16:30:06 +1100
commit1a0442fce894dc09c50d882d9d19f8ed95977a3f (patch)
treeed2c6c31b41bbada49bde934fc97ecd3cab284d8
parent01ed2272a1545336173bf3aef66fbccc3494c8d8 (diff)
- stevesk@cvs.openbsd.org 2008/11/04 19:18:00
[readconf.c] 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@
-rw-r--r--ChangeLog12
-rw-r--r--readconf.c12
2 files changed, 16 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 012749b0d..d49180e6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,16 @@
26 compiled-time disabled (turn on -DJPAKE in Makefile.inc). 26 compiled-time disabled (turn on -DJPAKE in Makefile.inc).
27 27
28 "just commit it. It isn't too intrusive." deraadt@ 28 "just commit it. It isn't too intrusive." deraadt@
29 - stevesk@cvs.openbsd.org 2008/11/04 19:18:00
30 [readconf.c]
31 because parse_forward() is now used to parse all forward types (DLR),
32 and it malloc's space for host variables, we don't need to malloc
33 here. fixes small memory leaks.
34
35 previously dynamic forwards were not parsed in parse_forward() and
36 space was not malloc'd in that case.
37
38 ok djm@
29 39
3020081103 4020081103
31 - OpenBSD CVS Sync 41 - OpenBSD CVS Sync
@@ -4876,4 +4886,4 @@
4876 OpenServer 6 and add osr5bigcrypt support so when someone migrates 4886 OpenServer 6 and add osr5bigcrypt support so when someone migrates
4877 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 4887 passwords between UnixWare and OpenServer they will still work. OK dtucker@
4878 4888
4879$Id: ChangeLog,v 1.5130 2008/11/05 05:20:46 djm Exp $ 4889$Id: ChangeLog,v 1.5131 2008/11/05 05:30:06 djm Exp $
diff --git a/readconf.c b/readconf.c
index ba70d9da0..d1ffd84a8 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.171 2008/11/04 08:22:13 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.172 2008/11/04 19:18:00 stevesk Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -256,10 +256,9 @@ add_local_forward(Options *options, const Forward *newfwd)
256 fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION); 256 fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION);
257 fwd = &options->local_forwards[options->num_local_forwards++]; 257 fwd = &options->local_forwards[options->num_local_forwards++];
258 258
259 fwd->listen_host = (newfwd->listen_host == NULL) ? 259 fwd->listen_host = newfwd->listen_host;
260 NULL : xstrdup(newfwd->listen_host);
261 fwd->listen_port = newfwd->listen_port; 260 fwd->listen_port = newfwd->listen_port;
262 fwd->connect_host = xstrdup(newfwd->connect_host); 261 fwd->connect_host = newfwd->connect_host;
263 fwd->connect_port = newfwd->connect_port; 262 fwd->connect_port = newfwd->connect_port;
264} 263}
265 264
@@ -277,10 +276,9 @@ add_remote_forward(Options *options, const Forward *newfwd)
277 SSH_MAX_FORWARDS_PER_DIRECTION); 276 SSH_MAX_FORWARDS_PER_DIRECTION);
278 fwd = &options->remote_forwards[options->num_remote_forwards++]; 277 fwd = &options->remote_forwards[options->num_remote_forwards++];
279 278
280 fwd->listen_host = (newfwd->listen_host == NULL) ? 279 fwd->listen_host = newfwd->listen_host;
281 NULL : xstrdup(newfwd->listen_host);
282 fwd->listen_port = newfwd->listen_port; 280 fwd->listen_port = newfwd->listen_port;
283 fwd->connect_host = xstrdup(newfwd->connect_host); 281 fwd->connect_host = newfwd->connect_host;
284 fwd->connect_port = newfwd->connect_port; 282 fwd->connect_port = newfwd->connect_port;
285} 283}
286 284