From 6b7fb78c99d0b34c4ea64ed0b20fefe6216f8231 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 2 Nov 2024 18:22:02 +0100 Subject: [PATCH] Make scope of the timeval structure cleaner in event_base_loop() Fixes: https://github.com/libevent/libevent/issues/1741 --- event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index 33f02a0a..9e439641 100644 --- a/event.c +++ b/event.c @@ -1975,7 +1975,6 @@ int event_base_loop(struct event_base *base, int flags) { const struct eventop *evsel = base->evsel; - struct timeval tv; struct timeval *tv_p; int res, done, retval = 0; struct evwatch_prepare_cb_info prepare_info; @@ -2009,6 +2008,8 @@ event_base_loop(struct event_base *base, int flags) base->event_gotterm = base->event_break = 0; while (!done) { + struct timeval tv; + base->event_continue = 0; base->n_deferreds_queued = 0;