summaryrefslogtreecommitdiffstats
path: root/mpi
diff options
context:
space:
mode:
Diffstat (limited to 'mpi')
-rw-r--r--mpi/mpi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mpi/mpi.c b/mpi/mpi.c
index 0e01fc26..e5d76f93 100644
--- a/mpi/mpi.c
+++ b/mpi/mpi.c
@@ -2404,7 +2404,12 @@ mp_err mp_bit(mp_int *a, mp_size bit)
a = &tmp;
}
- return (digit < USED(a) && (DIGITS(a)[digit] & mask) != 0) ? MP_YES : MP_NO;
+ res = (digit < USED(a) && (DIGITS(a)[digit] & mask) != 0) ? MP_YES : MP_NO;
+
+ if (a_neg)
+ mp_clear(&tmp);
+
+ return res;
}
mp_err mp_to_double(mp_int *mp, double *d)