diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index af7a49646e9..0fa18eb88e1 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1663,6 +1663,14 @@ NTSTATUS copy_internals(TALLOC_CTX *ctx, set_close_write_time(fsp2, smb_fname_src->st.st_ex_mtime); status = close_file_free(NULL, &fsp2, NORMAL_CLOSE); + if (!NT_STATUS_IS_OK(status)) { + DBG_WARNING("close_file_free() failed: %s\n", + nt_errstr(status)); + /* + * We can't do much but leak the fsp + */ + goto out; + } /* Grrr. We have to do this as open_file_ntcreate adds FILE_ATTRIBUTE_ARCHIVE when it creates the file. This isn't the correct thing to do in the copy