diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index b5e9cc9332..735385557c 100644 --- a/src/common/compat_libevent.c +++ b/src/common/compat_libevent.c @@ -243,7 +243,8 @@ tor_init_libevent_rng(void) void tor_libevent_free_all(void) { - event_base_free(the_event_base); + if (the_event_base) + event_base_free(the_event_base); the_event_base = NULL; }