summaryrefslogtreecommitdiff
path: root/source/rpc_server
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-01-22 10:17:37 -0800
committerKarolin Seeger <kseeger@samba.org>2009-01-23 09:07:38 +0100
commit6b93dd04ee4dff93be3d66d7ab223e8b81e77d93 (patch)
treef50ca2b7161905538019f3afca714b7c3ecb805f /source/rpc_server
parent5739cc5eb4d222b435a3cc32c1733288bf3d5635 (diff)
downloadsamba-6b93dd04ee4dff93be3d66d7ab223e8b81e77d93.tar.gz
Memory leaks and other fixes found by Coverity
(cherry picked from commit ba576efa8f884f3dd37bb5035fbb47ae0305c0b0)
Diffstat (limited to 'source/rpc_server')
-rw-r--r--source/rpc_server/srv_pipe.c4
-rw-r--r--source/rpc_server/srv_spoolss_nt.c3
-rw-r--r--source/rpc_server/srv_svcctl_nt.c1
3 files changed, 5 insertions, 3 deletions
diff --git a/source/rpc_server/srv_pipe.c b/source/rpc_server/srv_pipe.c
index be7d3db4443..705add6f7b3 100644
--- a/source/rpc_server/srv_pipe.c
+++ b/source/rpc_server/srv_pipe.c
@@ -732,7 +732,7 @@ static int rpc_lookup_size;
bool api_pipe_bind_auth3(pipes_struct *p, prs_struct *rpc_in_p)
{
RPC_HDR_AUTH auth_info;
- uint32 pad;
+ uint32 pad = 0;
DATA_BLOB blob;
ZERO_STRUCT(blob);
@@ -1871,6 +1871,8 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
return False;
}
+ ZERO_STRUCT(hdr_rb);
+
DEBUG(5,("api_pipe_alter_context: decode request. %d\n", __LINE__));
/* decode the alter context request */
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index 635898a9d57..a2dd5d4a2cb 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -9931,7 +9931,8 @@ WERROR _spoolss_xcvdataport(pipes_struct *p, SPOOL_Q_XCVDATAPORT *q_u, SPOOL_R_X
/* Allocate the outgoing buffer */
- rpcbuf_init( &r_u->outdata, q_u->offered, p->mem_ctx );
+ if (!rpcbuf_init( &r_u->outdata, q_u->offered, p->mem_ctx ))
+ return WERR_NOMEM;
switch ( Printer->printer_type ) {
case SPLHND_PORTMON_TCP:
diff --git a/source/rpc_server/srv_svcctl_nt.c b/source/rpc_server/srv_svcctl_nt.c
index bfd1c3b4c61..dbe0981f822 100644
--- a/source/rpc_server/srv_svcctl_nt.c
+++ b/source/rpc_server/srv_svcctl_nt.c
@@ -679,7 +679,6 @@ WERROR _svcctl_QueryServiceConfigW(pipes_struct *p,
/* we have to set the outgoing buffer size to the same as the
incoming buffer size (even in the case of failure */
-
*r->out.bytes_needed = r->in.buf_size;
wresult = fill_svc_config( p->mem_ctx, info->name, r->out.query, p->pipe_user.nt_user_token );