ntvfs: Fix Coverity ID 1107224 Resource leak
authorVolker Lendecke <vl@samba.org>
Sun, 20 Oct 2013 15:11:16 +0000 (17:11 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 21 Oct 2013 23:34:19 +0000 (16:34 -0700)
In this error path we were leaking "fd".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/ntvfs/posix/pvfs_open.c

index a095f746331adca236e69caae9d1d8afe06d471e..ceee64255f23f641517044745df5d05f8547e539 100644 (file)
@@ -717,7 +717,9 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
        if (io->generic.in.query_maximal_access) {
                status = pvfs_access_maximal_allowed(pvfs, req, name, 
                                                     &io->generic.out.maximal_access);
-               NT_STATUS_NOT_OK_RETURN(status);
+               if (!NT_STATUS_IS_OK(status)) {
+                       goto cleanup_delete;
+               }
        }
 
        /* form the lock context used for byte range locking and