summaryrefslogtreecommitdiff
path: root/mpq/clear.c
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2018-04-26 23:37:52 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2018-04-26 23:37:52 +0200
commit50af3bf618a4a1e693b129779ed8cbe7c88dc430 (patch)
treea1501d13d45123d95f4f7f916a90792ee97b00c1 /mpq/clear.c
parent252c79afb2e57270a9b1c590ebc5db311a147642 (diff)
downloadgmp-50af3bf618a4a1e693b129779ed8cbe7c88dc430.tar.gz
mpq/: Support lazy mpq_t also in the denominator.
Diffstat (limited to 'mpq/clear.c')
-rw-r--r--mpq/clear.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpq/clear.c b/mpq/clear.c
index c5baa77f4..89c7933c6 100644
--- a/mpq/clear.c
+++ b/mpq/clear.c
@@ -35,5 +35,6 @@ mpq_clear (mpq_t x)
{
if (ALLOC (NUM(x)))
__GMP_FREE_FUNC_LIMBS (PTR(NUM(x)), ALLOC(NUM(x)));
- __GMP_FREE_FUNC_LIMBS (PTR(DEN(x)), ALLOC(DEN(x)));
+ if (ALLOC (DEN(x)))
+ __GMP_FREE_FUNC_LIMBS (PTR(DEN(x)), ALLOC(DEN(x)));
}