summaryrefslogtreecommitdiff
path: root/source3/include/rpc_client.h
diff options
context:
space:
mode:
authorMarc VanHeyningen <marc.vanheyningen@isilon.com>2008-03-14 14:26:28 -0800
committerVolker Lendecke <vl@samba.org>2008-03-17 20:52:25 +0100
commite06aa46b9fab1e107fea8f6453fb13deffa91e96 (patch)
treedb972999f1b17db3e6b100fec70b5f4643632172 /source3/include/rpc_client.h
parent6274929b1e1ddf89f4c5e93414121eaf06b6ab14 (diff)
downloadsamba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.gz
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.bz2
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.zip
Coverity fixes
(This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363)
Diffstat (limited to 'source3/include/rpc_client.h')
-rw-r--r--source3/include/rpc_client.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/include/rpc_client.h b/source3/include/rpc_client.h
index e1ebb2509d..c552271ee7 100644
--- a/source3/include/rpc_client.h
+++ b/source3/include/rpc_client.h
@@ -36,6 +36,8 @@
#include "librpc/gen_ndr/cli_dssetup.h"
#include "librpc/gen_ndr/cli_ntsvcs.h"
+#define prs_init_empty( _ps_, _ctx_, _io_ ) (void) prs_init((_ps_), 0, (_ctx_), (_io_))
+
/* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */
#define CLI_DO_RPC_INTERNAL( pcli, ctx, p_idx, opnum, q_in, r_out, \
@@ -45,10 +47,7 @@
if (!prs_init( &q_ps, RPC_MAX_PDU_FRAG_LEN, ctx, MARSHALL )) { \
return NT_STATUS_NO_MEMORY;\
}\
- if (!prs_init( &r_ps, 0, ctx, UNMARSHALL )) {\
- prs_mem_free( &q_ps );\
- return NT_STATUS_NO_MEMORY;\
- }\
+ prs_init_empty( &r_ps, ctx, UNMARSHALL );\
if ( copy_sess_key) prs_set_session_key(&q_ps, (const char *)pcli->dc->sess_key);\
if ( q_io_fn("", &q_in, &q_ps, 0) ) {\
NTSTATUS _smb_pipe_stat_ = rpc_api_pipe_req(pcli, opnum, &q_ps, &r_ps); \
@@ -96,10 +95,7 @@
if (!prs_init( &q_ps, RPC_MAX_PDU_FRAG_LEN, ctx, MARSHALL )) { \
return WERR_NOMEM;\
}\
- if (!prs_init( &r_ps, 0, ctx, UNMARSHALL )) {\
- prs_mem_free( &q_ps );\
- return WERR_NOMEM;\
- }\
+ prs_init_empty( &r_ps, ctx, UNMARSHALL );\
if ( q_io_fn("", &q_in, &q_ps, 0) ) {\
NTSTATUS _smb_pipe_stat_ = rpc_api_pipe_req(pcli, opnum, &q_ps, &r_ps); \
if (!NT_STATUS_IS_OK(_smb_pipe_stat_)) {\