From f8994bc2890fa83ffffb4bbd89214d78968e7e04 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 10 Oct 2024 17:14:10 +0200 Subject: [PATCH] smbd: Fix an error resource leak in OpenDir_from_pathref() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We have to undo the fsp allocation and open we've done. Not noticed, it's probably highly unlikely OpenDir_fsp() fails. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Tue Nov 12 13:26:10 UTC 2024 on atb-devel-224 --- source3/smbd/dir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 64a747f294f..3aaf070d5ad 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1077,6 +1077,8 @@ NTSTATUS OpenDir_from_pathref(TALLOC_CTX *mem_ctx, status = OpenDir_fsp(mem_ctx, fsp->conn, fsp, mask, attr, &dir_hnd); if (!NT_STATUS_IS_OK(status)) { + fd_close(fsp); + file_free(NULL, fsp); return status; } -- 2.47.2