diff libtommath/bn_mp_init_copy.c @ 1478:3a933956437e coverity

update coverity
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 23:49:22 +0800
parents 8bba51a55704
children f52919ffd3b1
line wrap: on
line diff
--- a/libtommath/bn_mp_init_copy.c	Sat Jun 24 23:33:16 2017 +0800
+++ b/libtommath/bn_mp_init_copy.c	Fri Feb 09 23:49:22 2018 +0800
@@ -23,10 +23,15 @@
   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$ */