|
|
@@ -196,6 +196,7 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
|
|
|
#ifdef HAVE_EVENT2_EVENT_H
|
|
|
{
|
|
|
struct event_config *cfg = event_config_new();
|
|
|
+ tor_assert(cfg);
|
|
|
|
|
|
#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
|
|
|
if (! torcfg->disable_iocp) {
|
|
|
@@ -224,6 +225,11 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
|
|
|
the_event_base = event_init();
|
|
|
#endif
|
|
|
|
|
|
+ if (!the_event_base) {
|
|
|
+ log_err(LD_GENERAL, "Unable to initialize Libevent: cannot continue.");
|
|
|
+ exit(1);
|
|
|
+ }
|
|
|
+
|
|
|
#if defined(HAVE_EVENT_GET_VERSION) && defined(HAVE_EVENT_GET_METHOD)
|
|
|
/* Making this a NOTICE for now so we can link bugs to a libevent versions
|
|
|
* or methods better. */
|