diff options
-rw-r--r-- | source3/modules/vfs_posix_eadb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/modules/vfs_posix_eadb.c b/source3/modules/vfs_posix_eadb.c index fff7c11dce..d188780b29 100644 --- a/source3/modules/vfs_posix_eadb.c +++ b/source3/modules/vfs_posix_eadb.c @@ -284,16 +284,15 @@ static int posix_eadb_unlink(vfs_handle_struct *handle, const struct smb_filename *smb_fname) { struct smb_filename *smb_fname_tmp = NULL; - NTSTATUS status; int ret = -1; struct tdb_wrap *ea_tdb; SMB_VFS_HANDLE_GET_DATA(handle, ea_tdb, struct tdb_wrap, return -1); - status = copy_smb_filename(talloc_tos(), smb_fname, &smb_fname_tmp); - if (!NT_STATUS_IS_OK(status)) { - errno = map_errno_from_nt_status(status); + smb_fname_tmp = cp_smb_filename(talloc_tos(), smb_fname); + if (smb_fname_tmp == NULL) { + errno = ENOMEM; return -1; } @@ -307,6 +306,8 @@ static int posix_eadb_unlink(vfs_handle_struct *handle, } if (smb_fname_tmp->st.st_ex_nlink == 1) { + NTSTATUS status; + /* Only remove record on last link to file. */ if (tdb_transaction_start(ea_tdb->tdb) != 0) { |