summaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-19 09:45:10 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-19 09:45:10 -0500
commite7907f15f9b7685fbdd24939a7266235a066f8a0 (patch)
tree7318cbd60daaeb7022555e558520a8abe2e862a5 /src/common/compat_libevent.c
parentc8a27d89b26394a0e802820fe891ef75787499ab (diff)
downloadtor-e7907f15f9b7685fbdd24939a7266235a066f8a0.tar.gz
tor-e7907f15f9b7685fbdd24939a7266235a066f8a0.zip
Don't call Libevent's event_base_free() on NULL.
It doesn't crash, but it produces a warning. Fixes bug 24933; bugfix on 322abc030e53c7e84ca9f22a47b2965f2. Bug not in any released Tor.
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c3
1 files changed, 2 insertions, 1 deletions
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;
}