changeset 5810:be31f7878b0d

Fix bignum/bigfloat memory leaks. See xemacs-patches message <CAHCOHQmYDTHSUhVSRmyGpoeUAX3kS6Ua14p6FcNzzDm0i3GaRQ@mail.gmail.com>.
author Jerry James <james@xemacs.org>
date Tue, 23 Sep 2014 16:50:48 -0600
parents 2f22818d92d4
children b527c25f36ce
files src/ChangeLog src/floatfns.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Sep 06 14:30:15 2014 +0100
+++ b/src/ChangeLog	Tue Sep 23 16:50:48 2014 -0600
@@ -1,3 +1,8 @@
+2014-09-23  Jerry James  <james@xemacs.org>
+
+	* floatfns.c (round_two_bignum_1): Fix memory leak.
+	(round_two_bigfloat): Ditto.
+
 2014-09-06  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* select-x.c (Fx_store_cutbuffer_internal):
--- a/src/floatfns.c	Sat Sep 06 14:30:15 2014 +0100
+++ b/src/floatfns.c	Tue Sep 23 16:50:48 2014 -0600
@@ -1681,6 +1681,10 @@
       *res = make_bignum_bg (floored);
       *remain = make_bignum_bg (scratch_bignum);
     }
+  bignum_fini (flsecond);
+  bignum_fini (floored);
+  bignum_fini (flooring);
+  bignum_fini (hi2);
 }
 
 static Lisp_Object
@@ -1835,6 +1839,7 @@
   bigfloat_div (divided, XBIGFLOAT_DATA (number), XBIGFLOAT_DATA (divisor));
 
   res0 = round_one_bigfloat_1 (divided);
+  bigfloat_fini (divided);
 
   bigfloat_set_prec (scratch_bigfloat, prec);
   bigfloat_set_prec (scratch_bigfloat2, prec);