From 83986414b0de36923f32c2c3330db6cbf4b0455f Mon Sep 17 00:00:00 2001 From: Jardel Weyrich Date: Fri, 12 Mar 2010 06:04:56 -0300 Subject: [PATCH] Fix infrequent memory leak in bufferevent_init_common(). --- bufferevent.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } } -- 2.40.0