From cded94e68d89a158cfd8eefe8e7e7c941e5d96b2 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Sun, 23 Aug 2020 14:51:51 -0400 Subject: [PATCH] refactor: Clear pointer earlier --- runtime/src/runtime.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/src/runtime.c b/runtime/src/runtime.c index 7552f6c..c6ba30c 100644 --- a/runtime/src/runtime.c +++ b/runtime/src/runtime.c @@ -185,6 +185,12 @@ listener_thread_main(void *dummy) struct module *module = (struct module *)epoll_events[i].data.ptr; assert(module); + /* + * I don't think we're responsible to cleanup epoll events, but clearing to trigger + * the assertion just in case. + */ + epoll_events[i].data.ptr = NULL; + /* Accept Client Request as a nonblocking socket, saving address information */ struct sockaddr_in client_address; socklen_t address_length = sizeof(client_address); @@ -240,9 +246,6 @@ listener_thread_main(void *dummy) (const struct sockaddr *)&client_address, request_arrival_timestamp, admissions_estimate); - /* Clear the */ - epoll_events[i].data.ptr = NULL; - /* Add to the Global Sandbox Request Scheduler */ global_request_scheduler_add(sandbox_request);