r16393: Klocwork #1164. Null deref.
authorJeremy Allison <jra@samba.org>
Tue, 20 Jun 2006 01:27:39 +0000 (01:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:18:51 +0000 (11:18 -0500)
Jeremy.
(This used to be commit c9a4ce51ed85686a35f350f4681b95d68adebbd6)

source3/printing/print_generic.c

index e445bc3ce0077eb595ce065d3fdb11eefa864bca..1ea762695b1707943c24eaacbf34deaf723f9d1e 100644 (file)
@@ -193,7 +193,7 @@ static int generic_queue_get(const char *printer_name,
        /* turn the lpq output into a series of job structures */
        qcount = 0;
        ZERO_STRUCTP(status);
-       if (numlines) {
+       if (numlines && qlines) {
                queue = SMB_MALLOC_ARRAY(print_queue_struct, numlines+1);
                if (!queue) {
                        file_lines_free(qlines);