From d72f50ff3284e15124a0f233c26339229fe305ac Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 8 Feb 2018 23:11:40 +0800 Subject: Update to libtommath v1.0.1 --- libtommath/bn_mp_init_copy.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libtommath/bn_mp_init_copy.c') diff --git a/libtommath/bn_mp_init_copy.c b/libtommath/bn_mp_init_copy.c index 9e15f36..37a57ec 100644 --- a/libtommath/bn_mp_init_copy.c +++ b/libtommath/bn_mp_init_copy.c @@ -23,10 +23,15 @@ int mp_init_copy (mp_int * a, mp_int * b) if ((res = mp_init_size (a, b->used)) != MP_OKAY) { return res; } - return mp_copy (b, a); + + if((res = mp_copy (b, a)) != MP_OKAY) { + mp_clear(a); + } + + return res; } #endif -/* $Source$ */ -/* $Revision$ */ -/* $Date$ */ +/* ref: $Format:%D$ */ +/* git commit: $Format:%H$ */ +/* commit time: $Format:%ai$ */ -- cgit v1.2.3