From: Volker Lendecke Date: Thu, 10 Oct 2024 15:14:10 +0000 (+0200) Subject: smbd: Fix an error resource leak in OpenDir_from_pathref() X-Git-Tag: tdb-1.4.13~537 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8994bc2890fa83ffffb4bbd89214d78968e7e04;p=thirdparty%2Fsamba.git smbd: Fix an error resource leak in OpenDir_from_pathref() 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 --- 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; }