mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 17:15:38 +01:00
Fixed memory leak in ecdh_compute_shared() in case of error
This commit is contained in:
parent
cca998a4c5
commit
b548d773b3
@ -65,7 +65,10 @@ int ecdh_compute_shared( const ecp_group *grp, mpi *z,
|
|||||||
MPI_CHK( ecp_mul( grp, &P, d, Q ) );
|
MPI_CHK( ecp_mul( grp, &P, d, Q ) );
|
||||||
|
|
||||||
if( ecp_is_zero( &P ) )
|
if( ecp_is_zero( &P ) )
|
||||||
return( POLARSSL_ERR_ECP_BAD_INPUT_DATA );
|
{
|
||||||
|
ret = POLARSSL_ERR_ECP_BAD_INPUT_DATA;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
MPI_CHK( mpi_copy( z, &P.X ) );
|
MPI_CHK( mpi_copy( z, &P.X ) );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user