From bd76c22f4c7ab39b79f5cf381d39bff1b974363f Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Thu, 18 Feb 2010 02:03:53 +0100 Subject: [PATCH] s3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer! Guenther (cherry picked from commit 8ce66fba03f782c0b9948a9835bb488cfa74acf9) (cherry picked from commit cb6fcb9b16b36fcdc68bef382dbd7ecf89521d4e) --- source3/rpc_server/srv_spoolss_nt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index b1343861567..2dac5f6c4ab 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4460,7 +4460,7 @@ static WERROR enumprinters_level5(TALLOC_CTX *mem_ctx, WERROR _spoolss_EnumPrinters(pipes_struct *p, struct spoolss_EnumPrinters *r) { - const char *name; + const char *name = NULL; WERROR result; /* that's an [in out] buffer */ @@ -4488,8 +4488,10 @@ WERROR _spoolss_EnumPrinters(pipes_struct *p, * Level 5: same as Level 2 */ - name = talloc_strdup_upper(p->mem_ctx, r->in.server); - W_ERROR_HAVE_NO_MEMORY(name); + if (name) { + name = talloc_strdup_upper(p->mem_ctx, r->in.server); + W_ERROR_HAVE_NO_MEMORY(name); + } switch (r->in.level) { case 0: -- 2.11.4.GIT