]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Fix memory leak in smbd_server_connection_terminate_done().
authorJeremy Allison <jra@samba.org>
Thu, 15 Sep 2022 00:05:05 +0000 (17:05 -0700)
committerNoel Power <npower@samba.org>
Fri, 23 Sep 2022 09:51:20 +0000 (09:51 +0000)
The function smbd_server_connection_terminate_done() does not free subreq
which is allocated in smbXsrv_connection_shutdown_send, this can be a
memory leakage if multi-channel is enabled.

Suggested fix by haihua yang <hhyangdev@gmail.com>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15174

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Sep 23 09:51:20 UTC 2022 on sn-devel-184

source3/smbd/smb2_server.c

index e8a91238baf46c5ddba4e758c038ff07d4f7c7b8..1cd5953f116d65ec997562ce82a645afb5d2542b 100644 (file)
@@ -1643,6 +1643,7 @@ static void smbd_server_connection_terminate_done(struct tevent_req *subreq)
        NTSTATUS status;
 
        status = smbXsrv_connection_shutdown_recv(subreq);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                exit_server("smbXsrv_connection_shutdown_recv failed");
        }