Skip to content

Commit

Permalink
Properly implement TlsTransport destructor for MbedTLS
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Oct 21, 2023
1 parent 67e081f commit 4fe5339
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/impl/tlstransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,15 @@ TlsTransport::TlsTransport(variant<shared_ptr<TcpTransport>, shared_ptr<HttpProx
}
}

TlsTransport::~TlsTransport() {}
TlsTransport::~TlsTransport() {
stop();

PLOG_DEBUG << "Destroying TLS transport";
mbedtls_entropy_free(&mEntropy);
mbedtls_ctr_drbg_free(&mDrbg);
mbedtls_ssl_free(&mSsl);
mbedtls_ssl_config_free(&mConf);
}

void TlsTransport::start() {
PLOG_DEBUG << "Starting TLS transport";
Expand Down

0 comments on commit 4fe5339

Please sign in to comment.