From: Jeremy Allison Date: Thu, 15 Sep 2022 00:05:05 +0000 (-0700) Subject: s3: smbd: Fix memory leak in smbd_server_connection_terminate_done(). X-Git-Tag: talloc-2.4.0~807 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b600b0c8d9690cb5eeded1e5925c8e667c11af04;p=thirdparty%2Fsamba.git s3: smbd: Fix memory leak in smbd_server_connection_terminate_done(). 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 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15174 Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Sep 23 09:51:20 UTC 2022 on sn-devel-184 --- 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"); }