summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_addmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/bn_mp_addmod.c')
-rw-r--r--libtommath/bn_mp_addmod.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libtommath/bn_mp_addmod.c b/libtommath/bn_mp_addmod.c
index 2636e2a..1dcfb67 100644
--- a/libtommath/bn_mp_addmod.c
+++ b/libtommath/bn_mp_addmod.c
@@ -14,10 +14,11 @@ mp_err mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
}
if ((err = mp_add(a, b, &t)) != MP_OKAY) {
- mp_clear(&t);
- return err;
+ goto LBL_ERR;
}
err = mp_mod(&t, c, d);
+
+LBL_ERR:
mp_clear(&t);
return err;
}