1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

pvfs_open: unify talloc behavior in pvfs_can_delete/rename/stat()

And also handle NULL for lckp in the error path
without crashing.

metze
This commit is contained in:
Stefan Metzmacher
2008-02-21 19:56:36 +01:00
parent daab9cb11e
commit 04eb1be0c6

View File

@@ -1461,8 +1461,10 @@ NTSTATUS pvfs_can_delete(struct pvfs_state *pvfs,
}
} else if (!NT_STATUS_IS_OK(status)) {
talloc_free(lck);
*lckp = lck;
} else if (lckp != NULL) {
if (lckp) {
*lckp = NULL;
}
} else if (lckp) {
*lckp = lck;
}
@@ -1513,8 +1515,10 @@ NTSTATUS pvfs_can_rename(struct pvfs_state *pvfs,
}
} else if (!NT_STATUS_IS_OK(status)) {
talloc_free(lck);
*lckp = lck;
} else if (lckp != NULL) {
if (lckp) {
*lckp = NULL;
}
} else if (lckp) {
*lckp = lck;
}
@@ -1549,6 +1553,10 @@ NTSTATUS pvfs_can_stat(struct pvfs_state *pvfs,
NTCREATEX_SHARE_ACCESS_WRITE,
0, 0);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(lck);
}
return status;
}