diff options
-rw-r--r-- | ext/spl/php_spl.c | 2 | ||||
-rw-r--r-- | ext/spl/tests/bug77360.phpt | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 92c7d8b336..e735cc0134 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -69,7 +69,7 @@ static zend_class_entry * spl_find_ce_by_name(zend_string *name, zend_bool autol zend_string *lc_name = zend_string_tolower(name); ce = zend_hash_find_ptr(EG(class_table), lc_name); - zend_string_free(lc_name); + zend_string_release(lc_name); } else { ce = zend_lookup_class(name); } diff --git a/ext/spl/tests/bug77360.phpt b/ext/spl/tests/bug77360.phpt new file mode 100644 index 0000000000..2afa535cd1 --- /dev/null +++ b/ext/spl/tests/bug77360.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #77360: class_uses causes segfault +--FILE-- +<?php + +class foobar {} +$str = "foo"; +$str .= "bar"; +var_dump(class_uses($str, false)); +var_dump(class_uses($str, false)); +var_dump($str); + +?> +--EXPECT-- +array(0) { +} +array(0) { +} +string(6) "foobar" |