summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2011-07-02 14:49:03 +0400
committerIgor Pashev <pashev.igor@gmail.com>2011-07-02 14:49:03 +0400
commit805f85143e1a85fcc40a5b039f44f07cff0f981a (patch)
tree05eeb8fb501762b4560b835b1d34dc61d172c47b
parent56d6ccc17a39361ede9bf1a4d6810690b76cda2b (diff)
downloadgcd-805f85143e1a85fcc40a5b039f44f07cff0f981a.tar.gz
Clear temporary integers in gcd2()
-rw-r--r--gcd-gmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcd-gmp.c b/gcd-gmp.c
index 3de49de..355c0cc 100644
--- a/gcd-gmp.c
+++ b/gcd-gmp.c
@@ -20,6 +20,8 @@ void gcd2(mpz_t r, mpz_t a1, mpz_t b1)
mpz_set(a, r); /* a = r; */
}
mpz_set(r, a);
+ mpz_clear(a);
+ mpz_clear(b);
}
void gcdn(mpz_t r, mpz_t a[], size_t n)