summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2014-02-13 17:51:11 +1300
committerAndreas Schneider <asn@cryptomilk.org>2014-03-05 16:33:21 +0100
commit952bc3cad05467959ba5aa08682d754bd80d543b (patch)
treeec59adb15fc07fbc6c50b9eeeeb17a7dada26905 /source4/ntvfs/posix
parent1f60aa8ec2e685517235aadbc11324d3b4a1a74d (diff)
downloadsamba-952bc3cad05467959ba5aa08682d754bd80d543b.tar.gz
Remove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.
Following the current coding guidelines, it is considered bad practice to return from within a macro and change control flow as they look like normal function calls. Change-Id: I133eb5a699757ae57b87d3bd3ebbcf5b556b0268 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index 657e1030632..b8632d2b46a 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -926,7 +926,10 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs,
*ret_sd = NULL;
acl = talloc(req, struct xattr_NTACL);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(acl, tmp_ctx);
+ if (acl == NULL) {
+ TALLOC_FREE(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
status = pvfs_acl_load(pvfs, parent, -1, acl);
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
@@ -954,10 +957,16 @@ NTSTATUS pvfs_acl_inherited_sd(struct pvfs_state *pvfs,
/* create the new sd */
sd = security_descriptor_initialise(req);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(sd, tmp_ctx);
+ if (sd == NULL) {
+ TALLOC_FREE(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
ids = talloc_array(sd, struct id_map, 2);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ids, tmp_ctx);
+ if (ids == NULL) {
+ TALLOC_FREE(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
ids[0].xid.id = geteuid();
ids[0].xid.type = ID_TYPE_UID;