From: mbuhl Date: Tue, 14 Sep 2021 11:04:21 +0000 (+0000) Subject: put back the mux_ctx memleak fix for SSH_CHANNEL_MUX_CLIENT X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=432c174cacd441b8ba819c122c1049d178fe7815;p=openbsd put back the mux_ctx memleak fix for SSH_CHANNEL_MUX_CLIENT OK mfriedl@ --- diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index b54d1b8eb6a..4903ad1c2d5 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.407 2021/05/19 01:24:05 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.408 2021/09/14 11:04:21 mbuhl Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -619,9 +619,11 @@ channel_free(struct ssh *ssh, Channel *c) debug("channel %d: free: %s, nchannels %u", c->self, c->remote_name ? c->remote_name : "???", n); - if (c->type == SSH_CHANNEL_MUX_CLIENT) + if (c->type == SSH_CHANNEL_MUX_CLIENT) { mux_remove_remote_forwardings(ssh, c); - else if (c->type == SSH_CHANNEL_MUX_LISTENER) { + free(c->mux_ctx); + c->mux_ctx = NULL; + } else if (c->type == SSH_CHANNEL_MUX_LISTENER) { free(c->mux_ctx); c->mux_ctx = NULL; }