Merge pull request #3979 from AndrzejKurek/coverity-seg-fault-context

Fix the usage of ssl context after its nullified
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index a25eecd..04d578c 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -1435,7 +1435,8 @@
 
 #if !defined(MBEDTLS_SSL_HW_RECORD_ACCEL) && \
     !defined(MBEDTLS_SSL_EXPORT_KEYS) && \
-    !defined(MBEDTLS_DEBUG_C)
+    !defined(MBEDTLS_DEBUG_C) && \
+    !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
     ssl = NULL; /* make sure we don't use it except for those cases */
     (void) ssl;
 #endif