summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r--source3/printing/printing.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 9fa4b9b8c6..77e32d5bf0 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1003,6 +1003,8 @@ int print_queue_status(int snum,
/* make sure the database is up to date */
if (print_cache_expired(snum)) print_queue_update(snum);
+
+ *queue = NULL;
/*
* Count the number of entries.
@@ -1011,6 +1013,9 @@ int print_queue_status(int snum,
tsc.snum = snum;
tdb_traverse(tdb, traverse_count_fn_queue, (void *)&tsc);
+ if (tsc.count == 0)
+ return 0;
+
/* Allocate the queue size. */
if (( tstruct.queue = (print_queue_struct *)malloc(sizeof(print_queue_struct)*tsc.count))
== NULL)