Merge remote-tracking branch 'public/pr/1721' into development-restricted

This commit is contained in:
Simon Butcher 2018-12-20 12:37:13 +00:00
commit b6cdf980bc
4 changed files with 29 additions and 15 deletions

View file

@ -66,10 +66,11 @@ void mbedtls_pk_init( mbedtls_pk_context *ctx )
*/
void mbedtls_pk_free( mbedtls_pk_context *ctx )
{
if( ctx == NULL || ctx->pk_info == NULL )
if( ctx == NULL )
return;
ctx->pk_info->ctx_free_func( ctx->pk_ctx );
if ( ctx->pk_info != NULL )
ctx->pk_info->ctx_free_func( ctx->pk_ctx );
mbedtls_platform_zeroize( ctx, sizeof( mbedtls_pk_context ) );
}