summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-08 06:42:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:11:06 -0500
commit82ab2bce5ad50834afc3fdff00a4df46d4b99049 (patch)
tree673647d525941ba84a92a13ea99746b9c0d9858a /source3
parent6491aed1ac91f3eb57bee52de511f684d9dc35e0 (diff)
downloadsamba-82ab2bce5ad50834afc3fdff00a4df46d4b99049.tar.gz
samba-82ab2bce5ad50834afc3fdff00a4df46d4b99049.tar.bz2
samba-82ab2bce5ad50834afc3fdff00a4df46d4b99049.zip
r14023: My last bug fix still left a potential null deref.
C- "must try harder" :-). Jeremy. (This used to be commit 9c55bf74ca28530045c5cb3cbfffad242039ca75)
Diffstat (limited to 'source3')
-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;