summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_rename.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-27 16:03:00 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-27 16:03:00 +0100
commit48e9b4cea10ad182af5fd4260ca1b7403fcfbf3a (patch)
treef204e65c0ab980834f314d13ce6b32721c8b7f66 /source4/ntvfs/posix/pvfs_rename.c
parent3101cb888d5cbad785050b8491b138d683d444fb (diff)
parentb42e3fb232ca68e869de4b39826da861f48e6771 (diff)
downloadsamba-48e9b4cea10ad182af5fd4260ca1b7403fcfbf3a.tar.gz
samba-48e9b4cea10ad182af5fd4260ca1b7403fcfbf3a.tar.bz2
samba-48e9b4cea10ad182af5fd4260ca1b7403fcfbf3a.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-trivial
(This used to be commit d96fcc52a70fd1236b767b1d88a39d78c4e8c48c)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_rename.c')
-rw-r--r--source4/ntvfs/posix/pvfs_rename.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c
index 65755e05cb..17c073ccab 100644
--- a/source4/ntvfs/posix/pvfs_rename.c
+++ b/source4/ntvfs/posix/pvfs_rename.c
@@ -192,8 +192,8 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
{
struct pvfs_filename *name1, *name2;
TALLOC_CTX *mem_ctx = talloc_new(req);
+ struct odb_lock *lck = NULL;
NTSTATUS status;
- struct odb_lock *lck, *lck2;
/* resolve the wildcard pattern for this name */
fname2 = pvfs_resolve_wildcard(mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), fname1, fname2);
@@ -216,6 +216,7 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
status = pvfs_can_rename(pvfs, req, name1, &lck);
if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(lck);
goto failed;
}
@@ -223,7 +224,7 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs,
status = pvfs_resolve_partial(pvfs, mem_ctx,
dir_path, fname2, &name2);
if (NT_STATUS_IS_OK(status)) {
- status = pvfs_can_delete(pvfs, req, name2, &lck2);
+ status = pvfs_can_delete(pvfs, req, name2, NULL);
if (!NT_STATUS_IS_OK(status)) {
goto failed;
}
@@ -311,7 +312,7 @@ static NTSTATUS pvfs_rename_mv(struct ntvfs_module_context *ntvfs,
struct pvfs_state *pvfs = ntvfs->private_data;
NTSTATUS status;
struct pvfs_filename *name1, *name2;
- struct odb_lock *lck;
+ struct odb_lock *lck = NULL;
/* resolve the cifs name to a posix name */
status = pvfs_resolve_name(pvfs, req, ren->rename.in.pattern1,
@@ -354,6 +355,7 @@ static NTSTATUS pvfs_rename_mv(struct ntvfs_module_context *ntvfs,
status = pvfs_can_rename(pvfs, req, name1, &lck);
if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(lck);
return status;
}
@@ -375,7 +377,6 @@ static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
struct pvfs_state *pvfs = ntvfs->private_data;
NTSTATUS status;
struct pvfs_filename *name1, *name2;
- struct odb_lock *lck;
switch (ren->ntrename.in.flags) {
case RENAME_FLAG_RENAME:
@@ -421,7 +422,7 @@ static NTSTATUS pvfs_rename_nt(struct ntvfs_module_context *ntvfs,
return status;
}
- status = pvfs_can_rename(pvfs, req, name1, &lck);
+ status = pvfs_can_rename(pvfs, req, name1, NULL);
if (!NT_STATUS_IS_OK(status)) {
return status;
}