summaryrefslogtreecommitdiff
path: root/tls.c
diff options
context:
space:
mode:
Diffstat (limited to 'tls.c')
-rw-r--r--tls.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tls.c b/tls.c
index adf071f..4a9641f 100644
--- a/tls.c
+++ b/tls.c
@@ -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);