aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--mpfr.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index ced3cdca..e7552341 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,12 @@
* awk.h (cleanup_mpfr): Add declaration.
* main.c (main): Add call to `cleanup_mpfr'.
+ Fix memory leak:
+
+ * mpfr.c (do_mpfr_div): Add unref to denominator and numerator
+ to not leak memory. Thanks to Katie Wasserman <katie@wass.net>
+ for isolating the problem to that routine.
+
2014-07-25 Arnold D. Robbins <arnold@skeeve.com>
* main.c (main): Add a warning message if -M is used and gawk was
diff --git a/mpfr.c b/mpfr.c
index 3c7cb5d8..52247978 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -1248,6 +1248,8 @@ do_mpfr_div(int nargs)
mpz_tdiv_qr(quotient->mpg_i, remainder->mpg_i, num->mpg_i, denom->mpg_i);
unref(num);
unref(denom);
+ unref(numerator);
+ unref(denominator);
sub = make_string("quotient", 8);
lhs = assoc_lookup(result, sub);