summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-10-20 20:26:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:08 -0500
commit6fc9098dcc1a1ef232b96f5d4c562bf340db8988 (patch)
treece04a28176073a26c067c31b8a48d97620d15cba
parenteb7a808f9811f08880319ccb3e22b4388a9f4434 (diff)
downloadsamba-6fc9098dcc1a1ef232b96f5d4c562bf340db8988.tar.gz
samba-6fc9098dcc1a1ef232b96f5d4c562bf340db8988.tar.bz2
samba-6fc9098dcc1a1ef232b96f5d4c562bf340db8988.zip
r11235: fix segfault in addprinter due to mixing talloc() and malloc()'d memory
(This used to be commit f6f78877b485be5efd5cf1f3147b2e9fee647e52)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c4
1 files changed, 1 insertions, 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);