diff options
author | Amitay Isaacs <amitay@gmail.com> | 2011-12-16 12:20:43 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2011-12-23 16:18:25 +1100 |
commit | f14ddcc2e13cae85545e516bdd44e93d2a7301c5 (patch) | |
tree | 4f1ef4fa23ab1feaaa00fc1e4c6c39f1f76f182c | |
parent | 3d139b49cbf2d036bc59bf34f657643c1069ebc0 (diff) | |
download | samba-f14ddcc2e13cae85545e516bdd44e93d2a7301c5.tar.gz samba-f14ddcc2e13cae85545e516bdd44e93d2a7301c5.tar.bz2 samba-f14ddcc2e13cae85545e516bdd44e93d2a7301c5.zip |
s4:rpc-dnsserver: Use handy macros for error checking
-rw-r--r-- | source4/rpc_server/dnsserver/dcerpc_dnsserver.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c index 8aaa36b6f0..5c1a20340a 100644 --- a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c +++ b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c @@ -1242,10 +1242,7 @@ static WERROR dnsserver_complex_operate_server(struct dnsserver_state *dsstate, } rout->ZoneListW2K->ZoneArray = talloc_zero_array(mem_ctx, struct DNS_RPC_ZONE_W2K *, zcount); - if (rout->ZoneListW2K->ZoneArray == NULL) { - talloc_free(zlist); - return WERR_NOMEM; - } + W_ERROR_HAVE_NO_MEMORY_AND_FREE(rout->ZoneListW2K->ZoneArray, zlist); for (i=0; i<zcount; i++) { rout->ZoneListW2K->ZoneArray[i] = talloc_zero(mem_ctx, struct DNS_RPC_ZONE_W2K); @@ -1270,10 +1267,7 @@ static WERROR dnsserver_complex_operate_server(struct dnsserver_state *dsstate, } rout->ZoneList->ZoneArray = talloc_zero_array(mem_ctx, struct DNS_RPC_ZONE_DOTNET *, zcount); - if (rout->ZoneList->ZoneArray == NULL) { - talloc_free(zlist); - return WERR_NOMEM; - } + W_ERROR_HAVE_NO_MEMORY_AND_FREE(rout->ZoneList->ZoneArray, zlist); for (i=0; i<zcount; i++) { rout->ZoneList->ZoneArray[i] = talloc_zero(mem_ctx, struct DNS_RPC_ZONE_DOTNET); @@ -1310,9 +1304,7 @@ static WERROR dnsserver_complex_operate_server(struct dnsserver_state *dsstate, int pcount = 2; dplist = talloc_zero_array(mem_ctx, struct DNS_RPC_DP_ENUM *, pcount); - if (dplist == NULL) { - return WERR_NOMEM; - } + W_ERROR_HAVE_NO_MEMORY(dplist); p = dsstate->partitions; for (i=0; i<pcount; i++) { |