diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-07-03 07:25:18 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-07-03 17:26:23 +1000 |
commit | aa6fa4bf3023fa0e5761cd8f4b2cd015d2de74dd (patch) | |
tree | fd2c2c5c69310c20397444982abbd40e4a0c3fc8 | |
parent | d8195914eb43b20b13381f4e5a74f9f8a14f0ded (diff) |
upstream: put back the mux_ctx memleak fix, but only for channels of
type SSH_CHANNEL_MUX_LISTENER; Specifically SSH_CHANNEL_MUX_PROXY channels
should not have this structure freed.
OpenBSD-Commit-ID: f3b213ae60405f77439e2b06262f054760c9d325
-rw-r--r-- | channels.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/channels.c b/channels.c index f23066dff..71c94f6cc 100644 --- a/channels.c +++ b/channels.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.400 2020/07/03 07:17:35 djm Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.401 2020/07/03 07:25:18 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -603,6 +603,10 @@ channel_free(struct ssh *ssh, Channel *c) | |||
603 | 603 | ||
604 | if (c->type == SSH_CHANNEL_MUX_CLIENT) | 604 | if (c->type == SSH_CHANNEL_MUX_CLIENT) |
605 | mux_remove_remote_forwardings(ssh, c); | 605 | mux_remove_remote_forwardings(ssh, c); |
606 | else if (c->type == SSH_CHANNEL_MUX_LISTENER) { | ||
607 | free(c->mux_ctx); | ||
608 | c->mux_ctx = NULL; | ||
609 | } | ||
606 | 610 | ||
607 | if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) { | 611 | if (log_level_get() >= SYSLOG_LEVEL_DEBUG3) { |
608 | s = channel_open_message(ssh); | 612 | s = channel_open_message(ssh); |