diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-02-13 17:51:11 +1300 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-03-05 16:33:21 +0100 |
commit | 952bc3cad05467959ba5aa08682d754bd80d543b (patch) | |
tree | ec59adb15fc07fbc6c50b9eeeeb17a7dada26905 /source4/dsdb/repl/drepl_out_helpers.c | |
parent | 1f60aa8ec2e685517235aadbc11324d3b4a1a74d (diff) | |
download | samba-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/dsdb/repl/drepl_out_helpers.c')
-rw-r--r-- | source4/dsdb/repl/drepl_out_helpers.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c index 8ddce322696..0bec88fcd84 100644 --- a/source4/dsdb/repl/drepl_out_helpers.c +++ b/source4/dsdb/repl/drepl_out_helpers.c @@ -280,7 +280,10 @@ static NTSTATUS dreplsrv_get_rodc_partial_attribute_set(struct dreplsrv_service pas->version = 1; pas->attids = talloc_array(pas, enum drsuapi_DsAttributeId, schema->num_attributes); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(pas->attids, pas); + if (pas->attids == NULL) { + TALLOC_FREE(pas); + return NT_STATUS_NO_MEMORY; + } for (i=0; i<schema->num_attributes; i++) { struct dsdb_attribute *a; @@ -296,7 +299,10 @@ static NTSTATUS dreplsrv_get_rodc_partial_attribute_set(struct dreplsrv_service } pas->attids = talloc_realloc(pas, pas->attids, enum drsuapi_DsAttributeId, pas->num_attids); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(pas->attids, pas); + if (pas->attids == NULL) { + TALLOC_FREE(pas); + return NT_STATUS_NO_MEMORY; + } *_pas = pas; return NT_STATUS_OK; @@ -321,7 +327,10 @@ static NTSTATUS dreplsrv_get_gc_partial_attribute_set(struct dreplsrv_service *s pas->version = 1; pas->attids = talloc_array(pas, enum drsuapi_DsAttributeId, schema->num_attributes); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(pas->attids, pas); + if (pas->attids == NULL) { + TALLOC_FREE(pas); + return NT_STATUS_NO_MEMORY; + } for (i=0; i<schema->num_attributes; i++) { struct dsdb_attribute *a; @@ -333,7 +342,10 @@ static NTSTATUS dreplsrv_get_gc_partial_attribute_set(struct dreplsrv_service *s } pas->attids = talloc_realloc(pas, pas->attids, enum drsuapi_DsAttributeId, pas->num_attids); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(pas->attids, pas); + if (pas->attids == NULL) { + TALLOC_FREE(pas); + return NT_STATUS_NO_MEMORY; + } *_pas = pas; return NT_STATUS_OK; |