Commit 853e5e42 authored by Neel Goyal's avatar Neel Goyal Committed by Facebook Github Bot

free up existing session in setSSLSession

Summary: Free up the session if its not null before assigning a new one

Reviewed By: shamdor-fb

Differential Revision: D7169809

fbshipit-source-id: fd026e8688525a764b9937c7f4b7bfb0cdece9eb
parent 634c47ea
...@@ -824,6 +824,9 @@ const SSL* AsyncSSLSocket::getSSL() const { ...@@ -824,6 +824,9 @@ const SSL* AsyncSSLSocket::getSSL() const {
} }
void AsyncSSLSocket::setSSLSession(SSL_SESSION *session, bool takeOwnership) { void AsyncSSLSocket::setSSLSession(SSL_SESSION *session, bool takeOwnership) {
if (sslSession_) {
SSL_SESSION_free(sslSession_);
}
sslSession_ = session; sslSession_ = session;
if (!takeOwnership && session != nullptr) { if (!takeOwnership && session != nullptr) {
// Increment the reference count // Increment the reference count
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment