summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
authordtucker <dtucker>2005-03-14 11:58:40 +0000
committerdtucker <dtucker>2005-03-14 11:58:40 +0000
commita1f1d9c1aabbf42036561fa76afc9d3580959590 (patch)
tree6d092d7b5d41731ee8a455e478cc804ed9c5eed8 /readconf.c
parent04ef7ac171f17c1df45c77ee123fbc74e7736e3d (diff)
downloadopenssh-a1f1d9c1aabbf42036561fa76afc9d3580959590.tar.gz
- 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 7173a8c2..f35fe564 100644
--- a/readconf.c
+++ b/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"
@@ -253,12 +253,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;