From 4d9f627cc8081307da3f84f784602533bd20c1e6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 9 Jul 2007 08:04:43 +0000 Subject: [PATCH] r23758: Fix Coverity id 385 --- source/rpc_server/srv_spoolss_nt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index 2047e13df36..464ca36f3c0 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -7490,8 +7490,13 @@ WERROR enumports_hook( int *count, char ***lines ) /* if no hook then just fill in the default port */ if ( !*cmd ) { - qlines = SMB_MALLOC_ARRAY( char*, 2 ); - qlines[0] = SMB_STRDUP( SAMBA_PRINTER_PORT_NAME ); + if (!(qlines = SMB_MALLOC_ARRAY( char*, 2 ))) { + return WERR_NOMEM; + } + if (!(qlines[0] = SMB_STRDUP( SAMBA_PRINTER_PORT_NAME ))) { + SAFE_FREE(qlines); + return WERR_NOMEM; + } qlines[1] = NULL; numlines = 1; }