Don't call Libevent's event_base_free() on NULL.

It doesn't crash, but it produces a warning.

Fixes bug 24933; bugfix on 322abc030e. Bug
not in any released Tor.
This commit is contained in:
Nick Mathewson 2018-01-19 09:45:10 -05:00
parent c8a27d89b2
commit e7907f15f9

View File

@ -243,6 +243,7 @@ tor_init_libevent_rng(void)
void void
tor_libevent_free_all(void) tor_libevent_free_all(void)
{ {
if (the_event_base)
event_base_free(the_event_base); event_base_free(the_event_base);
the_event_base = NULL; the_event_base = NULL;
} }