diff options
-rw-r--r-- | dtls.c | 6 | ||||
-rw-r--r-- | tls.c | 6 |
2 files changed, 8 insertions, 4 deletions
@@ -330,8 +330,10 @@ void *dtlsservernew(void *arg) { X509_free(cert); exit: - SSL_shutdown(ssl); - SSL_free(ssl); + if (ssl) { + SSL_shutdown(ssl); + SSL_free(ssl); + } pthread_mutex_lock(¶ms->sesscache->mutex); freebios(params->sesscache->rbios); params->sesscache->rbios = NULL; @@ -365,8 +365,10 @@ void *tlsservernew(void *arg) { X509_free(cert); exit: - SSL_shutdown(ssl); - SSL_free(ssl); + if (ssl) { + SSL_shutdown(ssl); + SSL_free(ssl); + } ERR_remove_state(0); shutdown(s, SHUT_RDWR); close(s); |