summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-02-18 02:03:53 +0100
committerGünther Deschner <gd@samba.org>2010-02-18 02:19:50 +0100
commit8ce66fba03f782c0b9948a9835bb488cfa74acf9 (patch)
tree0ce31b47377078a11cd37cb3362646fe0b830f0a /source3
parent2d2db2a8226f6a3a8e114abc9a37aea66dba912e (diff)
downloadsamba-8ce66fba03f782c0b9948a9835bb488cfa74acf9.tar.gz
samba-8ce66fba03f782c0b9948a9835bb488cfa74acf9.tar.bz2
samba-8ce66fba03f782c0b9948a9835bb488cfa74acf9.zip
s3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer!
Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 49ca8c2c2b..30bedc69e1 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: