]> granicus.if.org Git - php/commitdiff
Fix refcounting of prop types coming from traits
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 8 Feb 2019 11:20:31 +0000 (12:20 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 8 Feb 2019 11:20:31 +0000 (12:20 +0100)
Zend/zend_inheritance.c

index acf09629d02361fc299ef645347e5e48f8dd943e..6a6684614523544f722555baed777a789a3e78a4 100644 (file)
@@ -1825,6 +1825,9 @@ static void zend_do_traits_property_binding(zend_class_entry *ce, zend_class_ent
 
                        Z_TRY_ADDREF_P(prop_value);
                        doc_comment = property_info->doc_comment ? zend_string_copy(property_info->doc_comment) : NULL;
+                       if (ZEND_TYPE_IS_NAME(property_info->type)) {
+                               zend_string_addref(ZEND_TYPE_NAME(property_info->type));
+                       }
                        zend_declare_typed_property(ce, prop_name, prop_value, flags, doc_comment, property_info->type);
                        zend_string_release_ex(prop_name, 0);
                } ZEND_HASH_FOREACH_END();