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/pem.c b/library/pem.c
index 2775ef9..3dd3b79 100644
--- a/library/pem.c
+++ b/library/pem.c
@@ -370,11 +370,8 @@
void pem_free( pem_context *ctx )
{
- if( ctx->buf )
- polarssl_free( ctx->buf );
-
- if( ctx->info )
- polarssl_free( ctx->info );
+ polarssl_free( ctx->buf );
+ polarssl_free( ctx->info );
memset( ctx, 0, sizeof( pem_context ) );
}