From 65c9d2e6216f71f258ea796d0959bf7e1e4d8732 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 30 Mar 2011 12:39:36 +0200 Subject: s3: Fix Coverity ID 2041, "UNUSED_VALUE" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Wed Mar 30 13:49:35 CEST 2011 on sn-devel-104 --- source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index 77627dc409..df882d729a 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -494,16 +494,20 @@ static void init_srv_share_info_1007(struct pipes_struct *p, ********************************************************************/ static void init_srv_share_info_1501(struct pipes_struct *p, - struct sec_desc_buf *r, + struct sec_desc_buf **r, int snum) { struct security_descriptor *sd; + struct sec_desc_buf *sd_buf = NULL; size_t sd_size; TALLOC_CTX *ctx = p->mem_ctx; sd = get_share_security(ctx, lp_servicename(snum), &sd_size); + if (sd) { + sd_buf = make_sec_desc_buf(p->mem_ctx, sd_size, sd); + } - r = make_sec_desc_buf(p->mem_ctx, sd_size, sd); + *r = sd_buf; } /******************************************************************* @@ -749,7 +753,9 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p, for (snum = 0; snum < num_services; snum++) { if (allowed[snum] && (resume_handle <= (i + valid_share_count++)) ) { - init_srv_share_info_1501(p, &ctr.ctr1501->array[i++], snum); + struct sec_desc_buf *sd_buf = NULL; + init_srv_share_info_1501(p, &sd_buf, snum); + ctr.ctr1501->array[i++] = *sd_buf; } } @@ -1483,7 +1489,7 @@ WERROR _srvsvc_NetShareGetInfo(struct pipes_struct *p, init_srv_share_info_1007(p, info->info1007, snum); break; case 1501: - init_srv_share_info_1501(p, info->info1501, snum); + init_srv_share_info_1501(p, &info->info1501, snum); break; default: DEBUG(5,("_srvsvc_NetShareGetInfo: unsupported switch value %d\n", -- cgit