Minor optimizations (original by Peter Vaskovic, modified by Paul Bakker)

Move strlen out of for loop.
Remove redundant null checks before free.
This commit is contained in:
Paul Bakker 2014-05-28 11:33:54 +02:00
parent 8ebfe084ab
commit 14b16c62e9
4 changed files with 9 additions and 12 deletions

View file

@ -321,8 +321,7 @@ void ssl_cache_free( ssl_cache_context *cache )
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 );