summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-03-14 22:58:40 +1100
committerDarren Tucker <dtucker@zip.com.au>2005-03-14 22:58:40 +1100
commit1d55ca748d6f1cab42aba290a0b77bd142830401 (patch)
tree6a303722c3f6ec5f0de649e840690ab941d16abd /readconf.c
parenta21380b70e0a72ce20ec8ebd4f9bb1e03134ca22 (diff)
- dtucker@cvs.openbsd.org 2005/03/10 10:15:02
[readconf.c] Check listen addresses for null, prevents xfree from dying during ClearAllForwardings (bz #996). From Craig Leres, ok markus@
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/readconf.c b/readconf.c
index 7173a8c23..f35fe5647 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.137 2005/03/04 08:48:06 djm Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.138 2005/03/10 10:15:02 dtucker Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -253,12 +253,14 @@ clear_forwardings(Options *options)
253 int i; 253 int i;
254 254
255 for (i = 0; i < options->num_local_forwards; i++) { 255 for (i = 0; i < options->num_local_forwards; i++) {
256 xfree(options->local_forwards[i].listen_host); 256 if (options->local_forwards[i].listen_host != NULL)
257 xfree(options->local_forwards[i].listen_host);
257 xfree(options->local_forwards[i].connect_host); 258 xfree(options->local_forwards[i].connect_host);
258 } 259 }
259 options->num_local_forwards = 0; 260 options->num_local_forwards = 0;
260 for (i = 0; i < options->num_remote_forwards; i++) { 261 for (i = 0; i < options->num_remote_forwards; i++) {
261 xfree(options->remote_forwards[i].listen_host); 262 if (options->remote_forwards[i].listen_host != NULL)
263 xfree(options->remote_forwards[i].listen_host);
262 xfree(options->remote_forwards[i].connect_host); 264 xfree(options->remote_forwards[i].connect_host);
263 } 265 }
264 options->num_remote_forwards = 0; 266 options->num_remote_forwards = 0;