summaryrefslogtreecommitdiffhomepage
path: root/libtommath/bn_mp_init_copy.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-02-08 23:11:40 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-02-08 23:11:40 +0800
commitd72f50ff3284e15124a0f233c26339229fe305ac (patch)
tree350fc0fb147ca0730219e0fec6573eff58fa4a65 /libtommath/bn_mp_init_copy.c
parentdebb20855380bad6547b8a3eee59da518bc6eed2 (diff)
Update to libtommath v1.0.1
Diffstat (limited to 'libtommath/bn_mp_init_copy.c')
-rw-r--r--libtommath/bn_mp_init_copy.c13
1 files changed, 9 insertions, 4 deletions
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$ */