From 5412b2c30d7ee228db1da4cfe2f5176ce4e29706 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 18 Feb 2024 19:40:00 +0100 Subject: [PATCH] bufferevent_ssl: fix freeing ctx in case of error in bufferevent_ssl_new_impl --- bufferevent_ssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bufferevent_ssl.c b/bufferevent_ssl.c index 44713e53..da56deaa 100644 --- a/bufferevent_ssl.c +++ b/bufferevent_ssl.c @@ -1088,8 +1088,8 @@ err: bev_ssl->ssl = NULL; bufferevent_free(&bev_ssl->bev.bev); } else { - if (ssl && (options & BEV_OPT_CLOSE_ON_FREE)) - bev_ssl->ssl_ops->free_raw(bev_ssl->ssl); + if (ssl && options & BEV_OPT_CLOSE_ON_FREE) + ssl_ops->free_raw(ssl); } return NULL; }