1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Fix possible memory leak in <MD>_ext()

This commit is contained in:
Andres Amaya Garcia
2017-07-20 14:34:08 +01:00
parent 94682d1d7d
commit 0963e6cfac
7 changed files with 35 additions and 29 deletions

View File

@ -406,17 +406,18 @@ int mbedtls_ripemd160_ext( const unsigned char *input,
mbedtls_ripemd160_init( &ctx );
if( ( ret = mbedtls_ripemd160_starts_ext( &ctx ) ) != 0 )
return( ret );
goto exit;
if( ( ret = mbedtls_ripemd160_update_ext( &ctx, input, ilen ) ) != 0 )
return( ret );
goto exit;
if( ( ret = mbedtls_ripemd160_finish_ext( &ctx, output ) ) != 0 )
return( ret );
goto exit;
exit:
mbedtls_ripemd160_free( &ctx );
return( 0 );
return( ret );
}
#if defined(MBEDTLS_SELF_TEST)