Skip to content

Commit da979a5

Browse files
committed
deal with a memory leak
1 parent c9f7c33 commit da979a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Zend/zend_namespaces.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ static zend_class_entry *insert_namespace(const zend_string *name) {
5151
ns = create_namespace(interned_name);
5252
ns->lexical_scope = parent_ns;
5353
zend_hash_add_ptr(EG(namespaces), interned_name, ns);
54+
55+
/* sometimes, opcache refuses to intern the string */
56+
if (interned_name == needle) {
57+
zend_string_release(interned_name);
58+
}
59+
} else {
60+
zend_string_release(needle);
5461
}
5562

5663
parent_ns = ns;

0 commit comments

Comments
 (0)