[tor-commits] [tor/master] Don't call Libevent's event_base_free() on NULL.

nickm at torproject.org nickm at torproject.org
Fri Jan 19 14:46:59 UTC 2018


commit e7907f15f9b7685fbdd24939a7266235a066f8a0
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jan 19 09:45:10 2018 -0500

    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.
---
 src/common/compat_libevent.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index b5e9cc933..735385557 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;
 }
 



More information about the tor-commits mailing list