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:
@ -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 ) );
|
||||
}
|
||||
|
Reference in New Issue
Block a user