]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ntvfs: Fix CID 1034883 Resource leak
authorVolker Lendecke <vl@samba.org>
Mon, 30 Sep 2024 09:01:04 +0000 (11:01 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 2 Oct 2024 13:12:30 +0000 (13:12 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/ntvfs/simple/vfs_simple.c

index 000da41f066400843360e5b4dc1310e3655c235c..794f06d3e06e612d8cdbc39a31dbe2e7a18f431b 100644 (file)
@@ -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) {