From 6fc9098dcc1a1ef232b96f5d4c562bf340db8988 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 20 Oct 2005 20:26:11 +0000 Subject: r11235: fix segfault in addprinter due to mixing talloc() and malloc()'d memory (This used to be commit f6f78877b485be5efd5cf1f3147b2e9fee647e52) --- source3/rpc_server/srv_spoolss_nt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index a8fc1bc229..026e7681e0 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -7413,13 +7413,11 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_ int snum; WERROR err = WERR_OK; - if ((printer = SMB_MALLOC_P(NT_PRINTER_INFO_LEVEL)) == NULL) { + if ( !(printer = TALLOC_ZERO_P(NULL, NT_PRINTER_INFO_LEVEL)) ) { DEBUG(0,("spoolss_addprinterex_level_2: malloc fail.\n")); return WERR_NOMEM; } - ZERO_STRUCTP(printer); - /* convert from UNICODE to ASCII - this allocates the info_2 struct inside *printer.*/ if (!convert_printer_info(info, printer, 2)) { free_a_printer(&printer, 2); -- cgit