Minor optimizations (original by Peter Vaskovic, modified by Paul Bakker)
Move strlen out of for loop.
Remove redundant null checks before free.
diff --git a/library/ssl_cache.c b/library/ssl_cache.c
index 9e49b9a..836b685 100644
--- a/library/ssl_cache.c
+++ b/library/ssl_cache.c
@@ -321,8 +321,7 @@
ssl_session_free( &prv->session );
#if defined(POLARSSL_X509_CRT_PARSE_C)
- if( prv->peer_cert.p != NULL )
- polarssl_free( prv->peer_cert.p );
+ polarssl_free( prv->peer_cert.p );
#endif /* POLARSSL_X509_CRT_PARSE_C */
polarssl_free( prv );