summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/common/util_groups.c
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/dsdb/common/util_groups.c
parent1f60aa8ec2e685517235aadbc11324d3b4a1a74d (diff)
downloadsamba-952bc3cad05467959ba5aa08682d754bd80d543b.tar.gz
samba-952bc3cad05467959ba5aa08682d754bd80d543b.tar.xz
samba-952bc3cad05467959ba5aa08682d754bd80d543b.zip
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/dsdb/common/util_groups.c')
-rw-r--r--source4/dsdb/common/util_groups.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/dsdb/common/util_groups.c b/source4/dsdb/common/util_groups.c
index 6a96ce89d1..c2075de25b 100644
--- a/source4/dsdb/common/util_groups.c
+++ b/source4/dsdb/common/util_groups.c
@@ -174,7 +174,10 @@ NTSTATUS dsdb_expand_nested_groups(struct ldb_context *sam_ctx,
if (!only_childs) {
*res_sids = talloc_realloc(res_sids_ctx, *res_sids,
struct dom_sid, *num_res_sids + 1);
- NT_STATUS_HAVE_NO_MEMORY_AND_FREE(*res_sids, tmp_ctx);
+ if (*res_sids == NULL) {
+ TALLOC_FREE(tmp_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
(*res_sids)[*num_res_sids] = sid;
++(*num_res_sids);
}