]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: fix memory leak in mux proxy mode when requesting forwarding.
authordjm@openbsd.org <djm@openbsd.org>
Wed, 6 Mar 2024 02:59:59 +0000 (02:59 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 6 Mar 2024 03:03:28 +0000 (14:03 +1100)
found by RASU JSC, reported by Maks Mishin in GHPR#467

OpenBSD-Commit-ID: 97d96a166b1ad4b8d229864a553e3e56d3116860

channels.c

index 6862556be74f9b8837af7354648acfb82258120a..ece8d30d614bdfd32e4d3d4d0179ee107bbbcd15 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.436 2024/01/09 22:19:00 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.437 2024/03/06 02:59:59 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -3245,9 +3245,8 @@ channel_proxy_downstream(struct ssh *ssh, Channel *downstream)
                        goto out;
                }
                /* Record that connection to this host/port is permitted. */
-               permission_set_add(ssh, FORWARD_USER, FORWARD_LOCAL, "<mux>", -1,
-                   listen_host, NULL, (int)listen_port, downstream);
-               listen_host = NULL;
+               permission_set_add(ssh, FORWARD_USER, FORWARD_LOCAL, "<mux>",
+                   -1, listen_host, NULL, (int)listen_port, downstream);
                break;
        case SSH2_MSG_CHANNEL_CLOSE:
                if (have < 4)