mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #49700 (memory leaks in php_date.c if garbage collector is enabled)
This commit is contained in:
parent
5aedea7179
commit
336e957951
2
NEWS
2
NEWS
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
15
ext/date/tests/bug49700.phpt
Normal file
15
ext/date/tests/bug49700.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user