Fix a possible double-free bug in SSL bufferevents with CLOSE_ON_FREE

With CLOSE_ON_FREE set, we were telling the BIO to free the bufferevent when
it was closed, and also freeing it ourselves.
This commit is contained in:
Nick Mathewson 2010-03-13 00:23:06 -05:00
parent 0d047c3f11
commit 75018951ec

View File

@ -1207,7 +1207,9 @@ bufferevent_openssl_filter_new(struct event_base *base,
enum bufferevent_ssl_state state,
int options)
{
int close_flag = options & BEV_OPT_CLOSE_ON_FREE;
/* We don't tell the BIO to close the bufferevent; we do it ourselves
* on be_openssl_destruct */
int close_flag = 0; /* options & BEV_OPT_CLOSE_ON_FREE; */
BIO *bio;
if (!underlying)
return NULL;