diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-02-13 18:08:56 +1300 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-03-05 16:33:21 +0100 |
commit | d2beff59ecd50ef2e77684bd0043c3d943a3b245 (patch) | |
tree | ba1c9f49b8ec8af484f2a3139c849f3e6280d2a1 /source4/dsdb/kcc | |
parent | 952bc3cad05467959ba5aa08682d754bd80d543b (diff) | |
download | samba-d2beff59ecd50ef2e77684bd0043c3d943a3b245.tar.gz |
Remove the remaining uses of the macro NT_STATUS_HAVE_NO_MEMORY_AND_FREE in 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: Id1b540cde127395a7b27385a7c0fe79f3a145c73
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/kcc')
-rw-r--r-- | source4/dsdb/kcc/kcc_topology.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source4/dsdb/kcc/kcc_topology.c b/source4/dsdb/kcc/kcc_topology.c index 258b73610cc..2836199a69e 100644 --- a/source4/dsdb/kcc/kcc_topology.c +++ b/source4/dsdb/kcc/kcc_topology.c @@ -1003,8 +1003,10 @@ static NTSTATUS kcctpl_setup_graph(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, graph->edge_sets.data, struct kcctpl_multi_edge_set, graph->edge_sets.count + 1); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(new_data, - tmp_ctx); + if (new_data == NULL) { + TALLOC_FREE(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } new_data[graph->edge_sets.count] = *edge_set; graph->edge_sets.data = new_data; graph->edge_sets.count++; @@ -2655,8 +2657,10 @@ static NTSTATUS kcctpl_get_spanning_tree_edges(struct kccsrv_service *service, vertex->edge_ids.data, struct GUID, vertex->edge_ids.count + 1); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(new_data, - tmp_ctx); + if (new_data == NULL) { + TALLOC_FREE(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } new_data[vertex->edge_ids.count] = edge->id; vertex->edge_ids.data = new_data; vertex->edge_ids.count++; @@ -3136,8 +3140,10 @@ static NTSTATUS kcctpl_create_connection(struct kccsrv_service *service, keep_connections.data, struct GUID, keep_connections.count + 1); - NT_STATUS_HAVE_NO_MEMORY_AND_FREE(new_data, - tmp_ctx); + if (new_data == NULL) { + TALLOC_FREE(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } new_data[keep_connections.count] = conn_guid; keep_connections.data = new_data; keep_connections.count++; |