From 952bc3cad05467959ba5aa08682d754bd80d543b Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Thu, 13 Feb 2014 17:51:11 +1300 Subject: 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 Reviewed-by: Jeremy Allison Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- source4/ntvfs/posix/pvfs_acl.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source4/ntvfs/posix') 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; -- cgit v1.2.1