aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-01 19:01:42 -0700
committerDamjan Marion <dmarion@me.com>2021-05-02 16:52:50 +0000
commit88dd3cf6033b336ff5635189464cd82e8047732d (patch)
tree1f265af93f4389a08cdf1cbff548154258612e97 /src/plugins
parent87f63898b4ad54c081e8aaeb35e465b2fe23b9b3 (diff)
tls: cleanup dtls migrated context
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I433cc1b7a29f785a431618641317bbfbbe2cf2f4
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/tlsopenssl/tls_openssl.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c
index 4278c34403d..df8f167cb1f 100644
--- a/src/plugins/tlsopenssl/tls_openssl.c
+++ b/src/plugins/tlsopenssl/tls_openssl.c
@@ -61,15 +61,20 @@ openssl_ctx_free (tls_ctx_t * ctx)
{
openssl_ctx_t *oc = (openssl_ctx_t *) ctx;
- if (SSL_is_init_finished (oc->ssl) && !ctx->is_passive_close)
- SSL_shutdown (oc->ssl);
+ /* Cleanup ssl ctx unless migrated */
+ if (!ctx->is_migrated)
+ {
+ if (SSL_is_init_finished (oc->ssl) && !ctx->is_passive_close)
+ SSL_shutdown (oc->ssl);
- SSL_free (oc->ssl);
+ SSL_free (oc->ssl);
+ vec_free (ctx->srv_hostname);
#ifdef HAVE_OPENSSL_ASYNC
openssl_evt_free (ctx->evt_index, ctx->c_thread_index);
#endif
- vec_free (ctx->srv_hostname);
+ }
+
pool_put_index (openssl_main.ctx_pool[ctx->c_thread_index],
oc->openssl_ctx_index);
}