Move fd_close on error path to be identical to all other error paths.
authorJeremy Allison <jra@samba.org>
Wed, 1 Jun 2011 19:17:43 +0000 (12:17 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 1 Jun 2011 20:30:03 +0000 (22:30 +0200)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  1 22:30:03 CEST 2011 on sn-devel-104

source3/smbd/open.c

index 373c0b3c42711e45f8ca245db08f97988ca4dfc3..d4b093468136cdd6dd2393f1e49357e69a9736d2 100644 (file)
@@ -2257,8 +2257,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                if (!NT_STATUS_IS_OK(status)) {
                        struct deferred_open_record state;
 
-                       fd_close(fsp);
-
                        state.delayed_for_oplocks = False;
                        state.id = id;
 
@@ -2274,6 +2272,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                                           req, &state);
                        }
                        TALLOC_FREE(lck);
+                       fd_close(fsp);
                        return status;
                }