[Samba] connection shutdown tevent_req is not freed

haihua yang hhyangdev at gmail.com
Mon Sep 5 04:29:52 UTC 2022


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.
Following is possible fix,

diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index e8a91238baf..1cd5953f116 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -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");

More information about the samba mailing list