From 32099fa948615d18d7e843c13cf26b886ac89bd9 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 12 Oct 2020 22:08:33 -0400 Subject: [PATCH] fix: correct allocate error handling --- runtime/src/local_runqueue_list.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/src/local_runqueue_list.c b/runtime/src/local_runqueue_list.c index e1595b1..ba5e8a1 100644 --- a/runtime/src/local_runqueue_list.c +++ b/runtime/src/local_runqueue_list.c @@ -52,17 +52,18 @@ local_runqueue_list_get_next() if (global_request_scheduler_remove(&sandbox_request) < 0) goto err; struct sandbox *sandbox = sandbox_allocate(sandbox_request); - if (!sandbox) goto err; + if (!sandbox) goto err_allocate; sandbox->state = SANDBOX_RUNNABLE; local_runqueue_add(sandbox); done: return sandbox; - err: + err_allocate: client_socket_send(sandbox_request->socket_descriptor, 503); client_socket_close(sandbox_request->socket_descriptor); free(sandbox_request); + err: sandbox = NULL; goto done; }