View | Details | Raw Unified | Return to bug 2363 | Differences between
and this patch

Collapse All | Expand All

(-)a/mux.c (-1 / +14 lines)
Lines 580-586 mux_confirm_remote_forward(int type, u_int32_t seq, void *ctxt) Link Here
580
		return;
580
		return;
581
	}
581
	}
582
	buffer_init(&out);
582
	buffer_init(&out);
583
	if (fctx->fid >= options.num_remote_forwards) {
583
	if (fctx->fid >= options.num_remote_forwards ||
584
	    (options.remote_forwards[fctx->fid].connect_path == NULL &&
585
	    options.remote_forwards[fctx->fid].connect_host == NULL)) {
584
		xasprintf(&failmsg, "unknown forwarding id %d", fctx->fid);
586
		xasprintf(&failmsg, "unknown forwarding id %d", fctx->fid);
585
		goto fail;
587
		goto fail;
586
	}
588
	}
Lines 614-619 mux_confirm_remote_forward(int type, u_int32_t seq, void *ctxt) Link Here
614
		else
616
		else
615
			xasprintf(&failmsg, "remote port forwarding failed for "
617
			xasprintf(&failmsg, "remote port forwarding failed for "
616
			    "listen port %d", rfwd->listen_port);
618
			    "listen port %d", rfwd->listen_port);
619
620
                debug2("%s: clearing registered forwarding for listen %d, "
621
		    "connect %s:%d", __func__, rfwd->listen_port,
622
		    rfwd->connect_path ? rfwd->connect_path :
623
		    rfwd->connect_host, rfwd->connect_port);
624
625
		free(rfwd->listen_host);
626
		free(rfwd->listen_path);
627
		free(rfwd->connect_host);
628
		free(rfwd->connect_path);
629
		memset(rfwd, 0, sizeof(*rfwd));
617
	}
630
	}
618
 fail:
631
 fail:
619
	error("%s: %s", __func__, failmsg);
632
	error("%s: %s", __func__, failmsg);

Return to bug 2363