From 8ce66fba03f782c0b9948a9835bb488cfa74acf9 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 --- 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 49ca8c2c2be..30bedc69e15 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4281,7 +4281,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 */ @@ -4309,8 +4309,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.34.1