]> granicus.if.org Git - libevent/commitdiff
Fix a possible double-free bug in SSL bufferevents with CLOSE_ON_FREE
authorNick Mathewson <nickm@torproject.org>
Sat, 13 Mar 2010 05:23:06 +0000 (00:23 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 13 Mar 2010 05:30:34 +0000 (00:30 -0500)
With CLOSE_ON_FREE set, we were telling the BIO to free the bufferevent when
it was closed, and also freeing it ourselves.

bufferevent_openssl.c

index a5aee02d5d4c8b842979ae9416a19299132d8736..86e674b97f9aeacff5fc2d06b3018682f9d7b00b 100644 (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;