diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-10-20 14:31:02 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-10-20 14:31:02 -0700 |
| commit | 813ba311c5c9dc0224752dab0214b5b5426e0129 (patch) | |
| tree | 301f7fd3470da8f058871f0281e5c02deb8309e0 /src/supplemental | |
| parent | e9dd113f27430e56d847fbca8b4f38bfd8810db9 (diff) | |
| download | nng-813ba311c5c9dc0224752dab0214b5b5426e0129.tar.gz nng-813ba311c5c9dc0224752dab0214b5b5426e0129.tar.bz2 nng-813ba311c5c9dc0224752dab0214b5b5426e0129.zip | |
openssl - handle NULL SSL object
Diffstat (limited to 'src/supplemental')
| -rw-r--r-- | src/supplemental/tls/openssl/openssl.c | 9 |
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 |
