mirror of
https://github.com/php/php-src.git
synced 2024-10-02 23:36:16 +00:00
Merge branch 'PHP-5.5'
This commit is contained in:
commit
d8374c5590
@ -710,6 +710,12 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, long ctor_fla
|
||||
}
|
||||
|
||||
intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
|
||||
if (intern->_path) {
|
||||
/* object is alreay initialized */
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Directory object is already initialized");
|
||||
return;
|
||||
}
|
||||
intern->flags = flags;
|
||||
#ifdef HAVE_GLOB
|
||||
if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) {
|
||||
|
11
ext/spl/tests/bug61828.phpt
Normal file
11
ext/spl/tests/bug61828.phpt
Normal file
@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
Bug #61828 (Memleak when calling Directory(Recursive)Iterator/Spl(Temp)FileObject ctor twice)
|
||||
--FILE--
|
||||
<?php
|
||||
$x = new DirectoryIterator('.');
|
||||
$x->__construct('/tmp');
|
||||
echo "Okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: DirectoryIterator::__construct(): Directory object is already initialized in %sbug61828.php on line 3
|
||||
Okey
|
Loading…
Reference in New Issue
Block a user