mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
Fix memory leak
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Union and intersection type leaks
|
||||
--FILE--
|
||||
<?php
|
||||
eval('abstract class y {function y(): (y&yy)|t {}}');
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
DONE
|
||||
@@ -110,9 +110,15 @@ ZEND_API void destroy_zend_function(zend_function *function)
|
||||
|
||||
ZEND_API void zend_type_release(zend_type type, bool persistent) {
|
||||
if (ZEND_TYPE_HAS_LIST(type)) {
|
||||
zend_type *list_type;
|
||||
zend_type *list_type, *sublist_type;
|
||||
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(type), list_type) {
|
||||
if (ZEND_TYPE_HAS_NAME(*list_type)) {
|
||||
if (ZEND_TYPE_HAS_LIST(*list_type)) {
|
||||
ZEND_TYPE_LIST_FOREACH(ZEND_TYPE_LIST(*list_type), sublist_type) {
|
||||
if (ZEND_TYPE_HAS_NAME(*sublist_type)) {
|
||||
zend_string_release(ZEND_TYPE_NAME(*sublist_type));
|
||||
}
|
||||
} ZEND_TYPE_LIST_FOREACH_END();
|
||||
} else if (ZEND_TYPE_HAS_NAME(*list_type)) {
|
||||
zend_string_release(ZEND_TYPE_NAME(*list_type));
|
||||
}
|
||||
} ZEND_TYPE_LIST_FOREACH_END();
|
||||
|
||||
Reference in New Issue
Block a user