summaryrefslogtreecommitdiff
path: root/mpz/clear.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpz/clear.c')
-rw-r--r--mpz/clear.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpz/clear.c b/mpz/clear.c
index d1541e91c..3be7deffa 100644
--- a/mpz/clear.c
+++ b/mpz/clear.c
@@ -36,5 +36,6 @@ see https://www.gnu.org/licenses/. */
void
mpz_clear (mpz_ptr x)
{
- __GMP_FREE_FUNC_LIMBS (PTR (x), ALLOC(x));
+ if (ALLOC (x))
+ __GMP_FREE_FUNC_LIMBS (PTR (x), ALLOC(x));
}