From: Nick Mathewson Date: Thu, 23 Apr 2009 21:34:37 +0000 (+0000) Subject: Oops. event_config.flags was never initialized. Bugfix on 2.0.1-alpha. Found by... X-Git-Tag: release-2.0.3-alpha~276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=faa756c7c19190dd8d5c27fa519870bac0c78cee;p=libevent Oops. event_config.flags was never initialized. Bugfix on 2.0.1-alpha. Found by Victor Goya. svn:r1236 --- diff --git a/ChangeLog b/ChangeLog index 3b1e0d53..de04e7b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Changes in 2.0.2-alpha: o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen] o Use signal.h, not sys/signal.h. [Patch from mmadia] o Try harder to build with certain older c99 compilers. + o Make sure that an event_config's flags field is always initialized to 0. [Bug report from Victor Goya] Changes in 2.0.1-alpha: o free minheap on event_base_free(); from Christopher Layne diff --git a/event.c b/event.c index 4792827f..f15b3b24 100644 --- a/event.c +++ b/event.c @@ -479,13 +479,12 @@ event_get_supported_methods(void) struct event_config * event_config_new(void) { - struct event_config *cfg = mm_malloc(sizeof(*cfg)); + struct event_config *cfg = mm_calloc(1, sizeof(*cfg)); if (cfg == NULL) return (NULL); TAILQ_INIT(&cfg->entries); - cfg->require_features = 0; return (cfg); }