mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Fix possible memory leak in <MD>_ext()
This commit is contained in:
parent
94682d1d7d
commit
0963e6cfac
7 changed files with 35 additions and 29 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue