From: Jardel Weyrich Date: Fri, 12 Mar 2010 09:04:56 +0000 (-0300) Subject: Fix infrequent memory leak in bufferevent_init_common(). X-Git-Tag: release-2.0.5-beta~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83986414b0de36923f32c2c3330db6cbf4b0455f;p=libevent Fix infrequent memory leak in bufferevent_init_common(). --- diff --git a/bufferevent.c b/bufferevent.c index 350d44db..1b6df74e 100644 --- a/bufferevent.c +++ b/bufferevent.c @@ -267,6 +267,10 @@ bufferevent_init_common(struct bufferevent_private *bufev_private, if (options & BEV_OPT_THREADSAFE) { if (bufferevent_enable_locking(bufev, NULL) < 0) { /* cleanup */ + evbuffer_free(bufev->input); + evbuffer_free(bufev->output); + bufev->input = NULL; + bufev->output = NULL; return -1; } }