From: Dmitry Stogov Date: Tue, 20 Apr 2010 15:41:35 +0000 (+0000) Subject: Fixed bug #49700 (memory leaks in php_date.c if garbage collector is enabled) X-Git-Tag: php-5.4.0alpha1~191^2~1734 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7d3ec6dee56adcadee72b9991f828f34fe4938c;p=php Fixed bug #49700 (memory leaks in php_date.c if garbage collector is enabled) --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 27025c096e..48b000272e 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2080,7 +2080,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; } @@ -2223,7 +2223,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; } diff --git a/ext/date/tests/bug49700.phpt b/ext/date/tests/bug49700.phpt new file mode 100644 index 0000000000..a347052593 --- /dev/null +++ b/ext/date/tests/bug49700.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #49700 (memory leaks in php_date.c if garbage collector is enabled) +--INI-- +date.timezone=GMT +--FILE-- + +--EXPECT-- +OK