1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

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

@ -370,11 +370,8 @@ int pem_read_buffer( pem_context *ctx, const char *header, const char *footer,
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 ) );
}