diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-19 09:45:10 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-19 09:45:10 -0500 |
commit | e7907f15f9b7685fbdd24939a7266235a066f8a0 (patch) | |
tree | 7318cbd60daaeb7022555e558520a8abe2e862a5 /src/common/compat_libevent.c | |
parent | c8a27d89b26394a0e802820fe891ef75787499ab (diff) | |
download | tor-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.c | 3 |
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; } |