summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/readconf.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2005-03-10 10:15:03 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2005-03-10 10:15:03 +0000
commitd635cc5af9a282f3a55b32ec055c29067fc01dae (patch)
tree3a0b1ffd6c2094392c5376c6beba70e694b21c98 /usr.bin/ssh/readconf.c
parentb08abf6d52fb6e580f8f8c823b4f765a7814f031 (diff)
Check listen addresses for null, prevents xfree from dying during
ClearAllForwardings (bz #996). From Craig Leres, ok markus@
Diffstat (limited to 'usr.bin/ssh/readconf.c')
-rw-r--r--usr.bin/ssh/readconf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c
index 7aae0c269cd..9e7f9ef91bf 100644
--- a/usr.bin/ssh/readconf.c
+++ b/usr.bin/ssh/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.137 2005/03/04 08:48:06 djm Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.138 2005/03/10 10:15:02 dtucker Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -251,12 +251,14 @@ clear_forwardings(Options *options)
int i;
for (i = 0; i < options->num_local_forwards; i++) {
- xfree(options->local_forwards[i].listen_host);
+ if (options->local_forwards[i].listen_host != NULL)
+ xfree(options->local_forwards[i].listen_host);
xfree(options->local_forwards[i].connect_host);
}
options->num_local_forwards = 0;
for (i = 0; i < options->num_remote_forwards; i++) {
- xfree(options->remote_forwards[i].listen_host);
+ if (options->remote_forwards[i].listen_host != NULL)
+ xfree(options->remote_forwards[i].listen_host);
xfree(options->remote_forwards[i].connect_host);
}
options->num_remote_forwards = 0;