diff options
author | Volker Lendecke <vl@samba.org> | 2011-03-27 21:17:53 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-03-27 22:22:12 +0200 |
commit | 9370c28425500c0ad8cff27886c49ce256a1e59e (patch) | |
tree | 1a9d33d42dea5c82024fd245616d4eb0895dca86 /librpc/rpc | |
parent | 240aeeb588a1c3f7f05efcf313cde3d06cce7720 (diff) | |
download | samba-9370c28425500c0ad8cff27886c49ce256a1e59e.tar.gz samba-9370c28425500c0ad8cff27886c49ce256a1e59e.tar.bz2 samba-9370c28425500c0ad8cff27886c49ce256a1e59e.zip |
librpc: Fix Coverity ID 2198: NULL_RETURNS
Diffstat (limited to 'librpc/rpc')
-rw-r--r-- | librpc/rpc/binding.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c index 422537e1f4..af47fcea3c 100644 --- a/librpc/rpc/binding.c +++ b/librpc/rpc/binding.c @@ -437,11 +437,17 @@ static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct nd return blob; } -static DATA_BLOB dcerpc_floor_pack_rhs_if_version_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax) +static bool dcerpc_floor_pack_rhs_if_version_data( + TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax, + DATA_BLOB *pblob) { DATA_BLOB blob; struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx); + if (ndr == NULL) { + return false; + } + ndr->flags |= LIBNDR_FLAG_NOALIGN; ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version >> 16); @@ -449,7 +455,8 @@ static DATA_BLOB dcerpc_floor_pack_rhs_if_version_data(TALLOC_CTX *mem_ctx, cons blob = ndr_push_blob(ndr); talloc_steal(mem_ctx, blob.data); talloc_free(ndr); - return blob; + *pblob = blob; + return true; } const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor) @@ -817,7 +824,11 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx, tower->floors[0].lhs.lhs_data = dcerpc_floor_pack_lhs_data(tower->floors, &binding->object); - tower->floors[0].rhs.uuid.unknown = dcerpc_floor_pack_rhs_if_version_data(tower->floors, &binding->object); + if (!dcerpc_floor_pack_rhs_if_version_data( + tower->floors, &binding->object, + &tower->floors[0].rhs.uuid.unknown)) { + return NT_STATUS_NO_MEMORY; + } /* Floor 1 */ tower->floors[1].lhs.protocol = EPM_PROTOCOL_UUID; |