Merge remote-tracking branch 'public/pr/1160' into mbedtls-2.1
* public/pr/1160:
Address PR review comments
Backport 2.1:Fix crash when calling `mbedtls_ssl_cache_free` twice
diff --git a/ChangeLog b/ChangeLog
index 14d0f5b..51d71b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,8 @@
* Add a check for invalid private parameters in ecdsa_sign.
Reported by Yolan Romailler.
* Fix word size check in in pk.c to not depend on MBEDTLS_HAVE_INT64.
+ * Fix crash when calling mbedtls_ssl_cache_free() twice. Found by
+ MilenkoMitrovic, #1104
Changes
* Extend cert_write example program by options to set the CRT version
diff --git a/library/ssl_cache.c b/library/ssl_cache.c
index 711bc53..14e350e 100644
--- a/library/ssl_cache.c
+++ b/library/ssl_cache.c
@@ -321,6 +321,7 @@
#if defined(MBEDTLS_THREADING_C)
mbedtls_mutex_free( &cache->mutex );
#endif
+ cache->chain = NULL;
}
#endif /* MBEDTLS_SSL_CACHE_C */