From fd8d0cba3fafc4900177fcfee3a5b6f95c845293 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 Sep 2024 11:01:04 +0200 Subject: [PATCH] ntvfs: Fix CID 1034883 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- source4/ntvfs/simple/vfs_simple.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c index 000da41f066..794f06d3e06 100644 --- a/source4/ntvfs/simple/vfs_simple.c +++ b/source4/ntvfs/simple/vfs_simple.c @@ -414,7 +414,10 @@ do_open: } status = ntvfs_handle_new(ntvfs, req, &handle); - NT_STATUS_NOT_OK_RETURN(status); + if (!NT_STATUS_IS_OK(status)) { + close(fd); + return status; + } f = talloc(handle, struct svfs_file); if (f == NULL) { -- 2.47.3