From b308b63b508401e04b59a060769463c21d30f53d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 11 Mar 2020 19:28:36 -0600 Subject: [PATCH] Fix potential use-after-free; Coverity CID 208814 --- logsrvd/logsrvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logsrvd/logsrvd.c b/logsrvd/logsrvd.c index 54135a46d..b7a84043b 100644 --- a/logsrvd/logsrvd.c +++ b/logsrvd/logsrvd.c @@ -98,6 +98,7 @@ connection_closure_free(struct connection_closure *closure) if (closure != NULL) { bool shutting_down = closure->state == SHUTDOWN; + struct sudo_event_base *evbase = closure->evbase; #if defined(HAVE_OPENSSL) SSL_free(closure->ssl); @@ -117,7 +118,7 @@ connection_closure_free(struct connection_closure *closure) free(closure); if (shutting_down && TAILQ_EMPTY(&connections)) - sudo_ev_loopbreak(closure->evbase); + sudo_ev_loopbreak(evbase); } debug_return;