From 41db0f7a1336c6a52471560ffd7c840f8c9a0246 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 16 Apr 2021 17:45:57 -0400 Subject: [PATCH] chore: Initialize and early out on completion queue free --- runtime/src/local_completion_queue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/src/local_completion_queue.c b/runtime/src/local_completion_queue.c index fe3eaf6..4bd3ec7 100644 --- a/runtime/src/local_completion_queue.c +++ b/runtime/src/local_completion_queue.c @@ -36,8 +36,10 @@ local_completion_queue_add(struct sandbox *sandbox) void local_completion_queue_free() { - struct sandbox *sandbox_iterator; - struct sandbox *buffer; + if (local_completion_queue_is_empty()) return; + + struct sandbox *sandbox_iterator = NULL; + struct sandbox *buffer = NULL; ps_list_foreach_del_d(&local_completion_queue, sandbox_iterator, buffer) {