summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
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;