1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r14286: Similar clarifiction fix for coverity #102.

Jeremy.
(This used to be commit f458596b0edd958321c5d4061f034846348a3fe6)
This commit is contained in:
Jeremy Allison 2006-03-13 03:59:53 +00:00 committed by Gerald (Jerry) Carter
parent e4600491cf
commit acc651a31b

View File

@ -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. */