mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01: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:
parent
8ebfe084ab
commit
14b16c62e9
4 changed files with 9 additions and 12 deletions
|
|
@ -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 ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue