MT#59962 xmlrpc2di: add `_ssl_ssl` and `_ssl_ctx` free handling

Additional logic around these two objects to free it during the
destruction phase.

Also add NULLing for the according pointers in other places
which might also free it before the destructor takes place,
which would lead otherwise to a double free attempt.

Change-Id: I046a660e4b1467a7093dbf2c0c3170a950d5f607
master
Donat Zenichev 1 month ago
parent 0a5b30dc96
commit afea04b0d6

@ -14,6 +14,13 @@ namespace XmlRpc {
XmlRpcSource::~XmlRpcSource()
{
if (_ssl_ssl) {
SSL_free(_ssl_ssl);
}
if (_ssl_ctx) {
SSL_CTX_free(_ssl_ctx);
}
}
@ -29,7 +36,9 @@ namespace XmlRpc {
if (_ssl_ssl != (SSL *) NULL) {
SSL_shutdown (_ssl_ssl);
SSL_free (_ssl_ssl);
_ssl_ssl = NULL;
SSL_CTX_free (_ssl_ctx);
_ssl_ctx = NULL;
}
if (_deleteOnClose) {
XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");

Loading…
Cancel
Save