summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/native/fdlibm/dtoa.c
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/native/fdlibm/dtoa.c')
-rw-r--r--libjava/classpath/native/fdlibm/dtoa.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/libjava/classpath/native/fdlibm/dtoa.c b/libjava/classpath/native/fdlibm/dtoa.c
index 6d5ad3b422e..5fb6aae2c21 100644
--- a/libjava/classpath/native/fdlibm/dtoa.c
+++ b/libjava/classpath/native/fdlibm/dtoa.c
@@ -2,7 +2,7 @@
*
* The author of this software is David M. Gay.
*
- * Copyright (c) 1991 by AT&T.
+ * Copyright (c) 1991, 2006 by AT&T.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose without fee is hereby granted, provided that this entire notice
@@ -897,10 +897,23 @@ _DEFUN (_dtoa,
{
struct _Jv_reent reent;
char *p;
+ int i;
+
memset (&reent, 0, sizeof reent);
p = _dtoa_r (&reent, _d, mode, ndigits, decpt, sign, rve, float_type);
strcpy (buf, p);
- return;
+ for (i = 0; i < reent._result_k; ++i)
+ {
+ struct _Jv_Bigint *l = reent._freelist[i];
+ while (l)
+ {
+ struct _Jv_Bigint *next = l->_next;
+ free (l);
+ l = next;
+ }
+ }
+ if (reent._freelist)
+ free (reent._freelist);
}
OpenPOWER on IntegriCloud