From 35cab4a8c27b3471557bbbd04d8bcf49dfec51c0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 21 Mar 2008 10:28:33 +0100 Subject: Fix Coverity ID 548 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Günther, please check -- in all infolevels we do a comment=talloc_strdup Thanks, Volker (This used to be commit e2021c5b5710768968ae724220eb1e3f47c9e639) --- source3/rpc_server/srv_srvsvc_nt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index a89a99646b..8359511939 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -1580,6 +1580,10 @@ WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, if (type != STYPE_DISKTREE) return WERR_ACCESS_DENIED; + if (comment == NULL) { + return WERR_NOMEM; + } + /* Check if the pathname is valid. */ if (!(path = valid_share_pathname(p->mem_ctx, pathname ))) return WERR_OBJECT_PATH_INVALID; @@ -1587,9 +1591,7 @@ WERROR _srvsvc_NetShareSetInfo(pipes_struct *p, /* Ensure share name, pathname and comment don't contain '"' characters. */ string_replace(share_name, '"', ' '); string_replace(path, '"', ' '); - if (comment) { - string_replace(comment, '"', ' '); - } + string_replace(comment, '"', ' '); DEBUG(10,("_srvsvc_NetShareSetInfo: change share command = %s\n", lp_change_share_cmd() ? lp_change_share_cmd() : "NULL" )); -- cgit