summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 2047e13df3..464ca36f3c 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/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;
}