summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-10-01 06:08:12 +0200
committerKarolin Seeger <kseeger@samba.org>2011-06-14 12:57:59 +0200
commitbcded87973ea112c7f6799424d95d05fc013d94f (patch)
tree71069b87781b6d58aca98c8f63eec7b25636e7f9
parentdf07498c8e770f4474a41833c85fa636830dea90 (diff)
downloadsamba-bcded87973ea112c7f6799424d95d05fc013d94f.tar.gz
s3-net: make sure we dont crash when publishing a single printer.
Guenther (cherry picked from commit 21576e3f8c32878910460bf9575c200ad93d682a) Part of a fix for bug #7993 ("net rpc printer MIGRATE" command fails). (cherry picked from commit 9c75728c62cccb8da606ece2d9df08b592e7c7c0)
-rw-r--r--source3/utils/net_rpc_printer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index dfc150fa3b0..8b6d73eb525 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -1091,6 +1091,11 @@ static bool get_printer_info(struct rpc_pipe_client *pipe_hnd,
&hnd))
return false;
+ *info_p = talloc_zero(mem_ctx, union spoolss_PrinterInfo);
+ if (*info_p == NULL) {
+ return false;
+ }
+
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, *info_p)) {
rpccli_spoolss_ClosePrinter(pipe_hnd, mem_ctx, &hnd, NULL);
return false;