s3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer!
authorGünther Deschner <gd@samba.org>
Thu, 18 Feb 2010 01:03:53 +0000 (02:03 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 18 Feb 2010 01:19:50 +0000 (02:19 +0100)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index 49ca8c2c2be42e06217e15797bccef5141f2617d..30bedc69e15059f8d5a23ca985bd2266fdd3f962 100644 (file)
@@ -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: