diff options
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/print_cups.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index 6d5a5460cd..0a40e5ec91 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -819,17 +819,16 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) { qalloc += 16; - if (qalloc == 16) - temp = malloc(sizeof(print_queue_struct) * qalloc); - else - temp = realloc(queue, sizeof(print_queue_struct) * qalloc); + temp = Realloc(queue, sizeof(print_queue_struct) * qalloc); if (temp == NULL) { + DEBUG(0,("cups_queue_get: Not enough memory!"); ippDelete(response); httpClose(http); - return (qcount); + free (queue); + return (0); } queue = temp; @@ -960,6 +959,7 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) DEBUG(0,("Unable to get printer status for %s - %s\n", PRINTERNAME(snum), ippErrorString(cupsLastError()))); httpClose(http); + *q = queue; return (qcount); } @@ -969,7 +969,7 @@ cups_queue_get(int snum, print_queue_struct **q, print_status_struct *status) ippErrorString(response->request.status.status_code))); ippDelete(response); httpClose(http); - + *q = queue; return (qcount); } |