From a84aa591d41532a17a43f54a741cfe51409c06eb Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 12 Jan 2023 15:25:40 +0100 Subject: [PATCH] Really avoid double free in async --- src/async.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/async.c b/src/async.c index 7c3aac3..fbb010a 100644 --- a/src/async.c +++ b/src/async.c @@ -272,7 +272,7 @@ void async_thread(void) { for (int i = 0; i < num_fds; i++) { evt_listen_t *evt = events[i].data.ptr; - if (evt == NULL) continue; + if (!list_contains(local, &evt)) continue; if (async_exec(evt, async_e2a(events[i].events)) == 0) { if (epoll_ctl(epoll_fd, EPOLL_CTL_DEL, evt->fd, NULL) == -1) { @@ -292,7 +292,6 @@ void async_thread(void) { } free(evt); - events[i].data.ptr = NULL; } }