summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-13 03:59:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:23 -0500
commitacc651a31be5f099aa5a13ba854b0a130be5d30d (patch)
tree136c9234da54ba71cb837cda5732912211ba0be9 /source3
parente4600491cf847668172c37857e972364b87b0c7a (diff)
downloadsamba-acc651a31be5f099aa5a13ba854b0a130be5d30d.tar.gz
samba-acc651a31be5f099aa5a13ba854b0a130be5d30d.tar.bz2
samba-acc651a31be5f099aa5a13ba854b0a130be5d30d.zip
r14286: Similar clarifiction fix for coverity #102.
Jeremy. (This used to be commit f458596b0edd958321c5d4061f034846348a3fe6)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 475862bc4c..573603b659 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7288,8 +7288,8 @@ static WERROR enumports_level_1(RPC_BUFFER *buffer, uint32 offered, uint32 *need
PORT_INFO_1 *ports=NULL;
int i=0;
WERROR result = WERR_OK;
- char **qlines;
- int numlines;
+ char **qlines = NULL;
+ int numlines = 0;
result = enumports_hook( &numlines, &qlines );
if (!W_ERROR_IS_OK(result)) {
@@ -7354,12 +7354,14 @@ static WERROR enumports_level_2(RPC_BUFFER *buffer, uint32 offered, uint32 *need
PORT_INFO_2 *ports=NULL;
int i=0;
WERROR result = WERR_OK;
- char **qlines;
- int numlines;
+ char **qlines = NULL;
+ int numlines = 0;
- if ( !W_ERROR_IS_OK(result = enumports_hook( &numlines, &qlines )) )
+ result = enumports_hook( &numlines, &qlines );
+ if ( !W_ERROR_IS_OK(result)) {
+ file_lines_free(qlines);
return result;
-
+ }
if(numlines) {
if((ports=SMB_MALLOC_ARRAY( PORT_INFO_2, numlines)) == NULL) {
@@ -7371,10 +7373,10 @@ static WERROR enumports_level_2(RPC_BUFFER *buffer, uint32 offered, uint32 *need
DEBUG(6,("Filling port number [%d] with port [%s]\n", i, qlines[i]));
fill_port_2(&(ports[i]), qlines[i]);
}
-
- file_lines_free(qlines);
}
+ file_lines_free(qlines);
+
*returned = numlines;
/* check the required size. */