From: Nick Mathewson Date: Wed, 14 Oct 2009 00:46:40 +0000 (+0000) Subject: Fix some crash bugs when initializing evdns X-Git-Tag: release-2.0.3-alpha~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc83ca3c7086fe1e1988722b95295c96d89a4152;p=libevent Fix some crash bugs when initializing evdns svn:r1443 --- diff --git a/ChangeLog b/ChangeLog index 459ec1b8..68929ee6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ Changes in 2.0.3-alpha: o Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec o New event_base_got_exit() and event_base_got_break() functions to tell whether an event loop exited because of an event_base_loopexit() or an event_base_loopbreak(). Patch from Ka-Hing Cheung. o When adding or deleting an event from a non-main thread, only wake up the main thread when its behavior actually needs to change. + o Fix some bugs when using the old evdns interfaces to initialize the evdns module. Changes in 2.0.2-alpha: diff --git a/evdns.c b/evdns.c index 60c836c1..31cccdfb 100644 --- a/evdns.c +++ b/evdns.c @@ -3228,6 +3228,8 @@ evdns_base_set_option_impl(struct evdns_base *base, int evdns_set_option(const char *option, const char *val, int flags) { + if (!current_base) + current_base = evdns_base_new(NULL, 0); return evdns_base_set_option(current_base, option, val, flags); } @@ -3355,6 +3357,8 @@ out1: int evdns_resolv_conf_parse(int flags, const char *const filename) { + if (!current_base) + current_base = evdns_base_new(NULL, 0); return evdns_base_resolv_conf_parse(current_base, flags, filename); } @@ -3574,7 +3578,6 @@ evdns_config_windows_nameservers(void) } else { return evdns_base_config_windows_nameservers(current_base); } - } #endif