Fixed bug #49700 (memory leaks in php_date.c if garbage collector is enabled)

This commit is contained in:
Dmitry Stogov 2010-04-20 15:41:35 +00:00
parent 5aedea7179
commit 336e957951
3 changed files with 19 additions and 2 deletions

2
NEWS
View File

@ -69,6 +69,8 @@ PHP NEWS
- Fixed bug #50358 (Compile failure compiling ext/phar/util.lo). (Felipe)
- Fixed bug #49778 (DateInterval::format("%a") is always zero when an interval
is created from an ISO string). (Derick)
- Fixed bug #49700 (memory leaks in php_date.c if garbage collector is
enabled). (Dmitry)
- Fixed bug #49576 (FILTER_VALIDATE_EMAIL filter needs updating) (Rasmus)
- Fixed bug #49429 (odbc_autocommit doesn't work). (Felipe)
- Fixed bug #49234 (mysqli_ssl_set not found). (Andrey)

View File

@ -2081,7 +2081,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
props = dateobj->std.properties;
if (!dateobj->time) {
if (!dateobj->time || GC_G(gc_active)) {
return props;
}
@ -2224,7 +2224,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
props = intervalobj->std.properties;
if (!intervalobj->initialized) {
if (!intervalobj->initialized || GC_G(gc_active)) {
return props;
}

View File

@ -0,0 +1,15 @@
--TEST--
Bug #49700 (memory leaks in php_date.c if garbage collector is enabled)
--INI--
date.timezone=GMT
--FILE--
<?php
gc_enable();
$objs = array();
$objs[1] = new DateTime();
gc_collect_cycles();
unset($objs);
echo "OK\n";
?>
--EXPECT--
OK