summaryrefslogtreecommitdiff
path: root/cipher
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-02-10 17:35:43 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-02-10 17:35:43 +0900
commitb12dd550fd6af687ef95c584d0d8366c34965cc8 (patch)
tree15a3f531774227775a9c07dbe9a5ae4a64d1d102 /cipher
parent4a19b195697e0b6534d28de9401ae3e9d86adb42 (diff)
downloadlibgcrypt-b12dd550fd6af687ef95c584d0d8366c34965cc8.tar.gz
ecc: Fix memory leaks on error.
* cipher/ecc.c (ecc_decrypt_raw): Go to leave to release memory. * mpi/ec.c (_gcry_mpi_ec_curve_point): Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher')
-rw-r--r--cipher/ecc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cipher/ecc.c b/cipher/ecc.c
index b861925b..d1fe8237 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1572,8 +1572,8 @@ ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
if (!_gcry_mpi_ec_curve_point (&kG, ec))
{
- point_free (&kG);
- return GPG_ERR_INV_DATA;
+ rc = GPG_ERR_INV_DATA;
+ goto leave;
}
/* R = dkG */