From 3cc0eace2e3fb72310af7d7f8c0f8ffac6cb1635 Mon Sep 17 00:00:00 2001 From: John Ohl Date: Tue, 16 Sep 2014 22:25:52 -0400 Subject: [PATCH] Fix use-after-free error in EV_CLOSURE_EVENT callback --- event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index a5e8d0b1..f3194977 100644 --- a/event.c +++ b/event.c @@ -1569,8 +1569,9 @@ event_process_active_single_queue(struct event_base *base, event_persist_closure(base, ev); break; case EV_CLOSURE_EVENT: { - void (*evcb_callback)(evutil_socket_t, short, void *) = *ev->ev_callback; + void (*evcb_callback)(evutil_socket_t, short, void *); EVUTIL_ASSERT(ev != NULL); + evcb_callback = *ev->ev_callback; EVBASE_RELEASE_LOCK(base, th_base_lock); evcb_callback(ev->ev_fd, ev->ev_res, ev->ev_arg); } -- 2.40.0