Fix infrequent memory leak in bufferevent_init_common().

This commit is contained in:
Jardel Weyrich 2010-03-12 06:04:56 -03:00 committed by Nick Mathewson
parent b557b175c0
commit 83986414b0

View File

@ -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;
}
}