mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-24 01:35:46 +00:00
Add missing calls to pem_free in pk_parse
This commit is contained in:
parent
713c9e187f
commit
b299a37a72
|
@ -1068,7 +1068,10 @@ int pk_parse_key( pk_context *pk,
|
|||
if( ret == 0 )
|
||||
{
|
||||
if( ( pk_info = pk_info_from_type( POLARSSL_PK_RSA ) ) == NULL )
|
||||
{
|
||||
pem_free( &pem );
|
||||
return( POLARSSL_ERR_PK_UNKNOWN_PK_ALG );
|
||||
}
|
||||
|
||||
if( ( ret = pk_init_ctx( pk, pk_info ) ) != 0 ||
|
||||
( ret = pk_parse_key_pkcs1_der( pk_rsa( *pk ),
|
||||
|
@ -1096,7 +1099,10 @@ int pk_parse_key( pk_context *pk,
|
|||
if( ret == 0 )
|
||||
{
|
||||
if( ( pk_info = pk_info_from_type( POLARSSL_PK_ECKEY ) ) == NULL )
|
||||
{
|
||||
pem_free( &pem );
|
||||
return( POLARSSL_ERR_PK_UNKNOWN_PK_ALG );
|
||||
}
|
||||
|
||||
if( ( ret = pk_init_ctx( pk, pk_info ) ) != 0 ||
|
||||
( ret = pk_parse_key_sec1_der( pk_ec( *pk ),
|
||||
|
|
Loading…
Reference in a new issue