summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/printing/print_generic.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index cb1c951ff7..e445bc3ce0 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -200,16 +200,17 @@ static int generic_queue_get(const char *printer_name,
*q = NULL;
return 0;
}
+ memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1));
+
+ for (i=0; i<numlines; i++) {
+ /* parse the line */
+ if (parse_lpq_entry(printing_type,qlines[i],
+ &queue[qcount],status,qcount==0)) {
+ qcount++;
+ }
+ }
}
- memset(queue, '\0', sizeof(print_queue_struct)*(numlines+1));
- for (i=0; i<numlines; i++) {
- /* parse the line */
- if (parse_lpq_entry(printing_type,qlines[i],
- &queue[qcount],status,qcount==0)) {
- qcount++;
- }
- }
file_lines_free(qlines);
*q = queue;
return qcount;