Commit b548d773 authored by Paul Bakker's avatar Paul Bakker

Fixed memory leak in ecdh_compute_shared() in case of error

parent cca998a4
......@@ -65,7 +65,10 @@ int ecdh_compute_shared( const ecp_group *grp, mpi *z,
MPI_CHK( ecp_mul( grp, &P, d, Q ) );
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 ) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment