diff --git a/source/darwin/dispatch_queue_event_loop.c b/source/darwin/dispatch_queue_event_loop.c index e234a191b..421f9b1a7 100644 --- a/source/darwin/dispatch_queue_event_loop.c +++ b/source/darwin/dispatch_queue_event_loop.c @@ -141,13 +141,14 @@ static struct aws_event_loop *aws_event_loop_new_dispatch_queue_with_options( AWS_PRECONDITION(options->clock); struct aws_event_loop *loop = aws_mem_calloc(alloc, 1, sizeof(struct aws_event_loop)); + struct dispatch_loop *dispatch_loop = NULL; AWS_LOGF_DEBUG(AWS_LS_IO_EVENT_LOOP, "id=%p: Initializing dispatch_queue event-loop", (void *)loop); if (aws_event_loop_init_base(loop, alloc, options->clock)) { goto clean_up; } - struct dispatch_loop *dispatch_loop = aws_mem_calloc(alloc, 1, sizeof(struct dispatch_loop)); + dispatch_loop = aws_mem_calloc(alloc, 1, sizeof(struct dispatch_loop)); aws_ref_count_init(&dispatch_loop->ref_count, loop, s_dispatch_event_loop_destroy); dispatch_loop->dispatch_queue_id = s_get_unique_dispatch_queue_id(alloc);