From be8b0685a55700c6bce3681734800ec6434b0364 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Apr 2007 02:39:34 +0000 Subject: r22589: Make TALLOC_ARRAY consistent across all uses. Jeremy. (This used to be commit 8968808c3b5b0208cbad9ac92eaf948f2c546dd9) --- source3/printing/notify.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/printing') diff --git a/source3/printing/notify.c b/source3/printing/notify.c index e2aed5ce25..744f7ae990 100644 --- a/source3/printing/notify.c +++ b/source3/printing/notify.c @@ -537,9 +537,13 @@ BOOL print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t num_pids = data.dsize / 8; - if ((pid_list = TALLOC_ARRAY(mem_ctx, pid_t, num_pids)) == NULL) { - ret = False; - goto done; + if (num_pids) { + if ((pid_list = TALLOC_ARRAY(mem_ctx, pid_t, num_pids)) == NULL) { + ret = False; + goto done; + } + } else { + pid_list = NULL; } for( i = 0, offset = 0; offset < data.dsize; offset += 8, i++) -- cgit