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:
@ -355,17 +355,18 @@ int mbedtls_sha256_ext( const unsigned char *input,
|
||||
mbedtls_sha256_init( &ctx );
|
||||
|
||||
if( ( ret = mbedtls_sha256_starts_ext( &ctx, is224 ) ) != 0 )
|
||||
return( ret );
|
||||
goto exit;
|
||||
|
||||
if( ( ret = mbedtls_sha256_update_ext( &ctx, input, ilen ) ) != 0 )
|
||||
return( ret );
|
||||
goto exit;
|
||||
|
||||
if( ( ret = mbedtls_sha256_finish_ext( &ctx, output ) ) != 0 )
|
||||
return( ret );
|
||||
goto exit;
|
||||
|
||||
exit:
|
||||
mbedtls_sha256_free( &ctx );
|
||||
|
||||
return( 0 );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
Reference in New Issue
Block a user