tony2001 Tue Feb 14 22:15:15 2006 UTC
Modified files: (Branch: PHP_5_0)
/ZendEngine2 zend_strtod.c
Log:
MF51:
fix leak in zend_strtod() on big doubles
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_strtod.c?r1=1.1.2.17&r2=1.1.2.18&diff_format=u
Index: ZendEngine2/zend_strtod.c
diff -u ZendEngine2/zend_strtod.c:1.1.2.17 ZendEngine2/zend_strtod.c:1.1.2.18
--- ZendEngine2/zend_strtod.c:1.1.2.17 Thu Feb 17 04:45:14 2005
+++ ZendEngine2/zend_strtod.c Tue Feb 14 22:15:15 2006
@@ -1250,7 +1250,7 @@
_double rv, rv0;
Long L;
ULong y, z;
- Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
+ Bigint *bb, *bb1, *bd, *bd0, *bs, *delta, *tmp;
double result;
CONST char decimal_point = '.';
@@ -1776,5 +1776,21 @@
if (se)
*se = (char *)s;
result = sign ? -value(rv) : value(rv);
+
+ for (i = 0; i <= Kmax; i++) {
+ Bigint **listp = &freelist[i];
+ while ((tmp = *listp) != NULL) {
+ *listp = tmp->next;
+ free(tmp);
+ }
+ freelist[i] = NULL;
+ }
+
+ while (p5s) {
+ tmp = p5s;
+ p5s = p5s->next;
+ free(tmp);
+ }
+
return result;
}
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|