aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/tls/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/supplemental/tls/openssl')
-rw-r--r--src/supplemental/tls/openssl/openssl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/supplemental/tls/openssl/openssl.c b/src/supplemental/tls/openssl/openssl.c
index 3a32946a..69364dd1 100644
--- a/src/supplemental/tls/openssl/openssl.c
+++ b/src/supplemental/tls/openssl/openssl.c
@@ -220,7 +220,10 @@ ossl_init_nng(void)
static void
ossl_conn_fini(nng_tls_engine_conn *ec)
{
- SSL_free(ec->ssl);
+ if (ec->ssl != NULL) {
+ SSL_free(ec->ssl);
+ ec->ssl = NULL;
+ }
}
static int
@@ -274,7 +277,9 @@ ossl_conn_init(nng_tls_engine_conn *ec, void *tls, nng_tls_engine_config *cfg,
static void
ossl_conn_close(nng_tls_engine_conn *ec)
{
- (void) SSL_shutdown(ec->ssl);
+ if (ec->ssl != NULL) {
+ (void) SSL_shutdown(ec->ssl);
+ }
}
static int