commit | b548d773b3140f7b3c38fdfe9393d2554742c626 | [log] [tgz] |
---|---|---|
author | Paul Bakker <p.j.bakker@polarssl.org> | Fri Jul 26 14:21:34 2013 +0200 |
committer | Paul Bakker <p.j.bakker@polarssl.org> | Fri Jul 26 14:22:19 2013 +0200 |
tree | 0682f24531fac12bad7345d00183e6206c40e3c3 | |
parent | cca998a4c5a9e11ff328f916943f52556b68270b [diff] [blame] |
Fixed memory leak in ecdh_compute_shared() in case of error
diff --git a/library/ecdh.c b/library/ecdh.c index df21eac..301275a 100644 --- a/library/ecdh.c +++ b/library/ecdh.c
@@ -65,7 +65,10 @@ 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 ) );