summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/php_spl.c')
-rw-r--r--ext/spl/php_spl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 9c7dc5caff..f16734422b 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -273,9 +273,9 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
if (ret == SUCCESS) {
zend_string *opened_path;
if (!file_handle.opened_path) {
- file_handle.opened_path = estrndup(class_file, class_file_len);
+ file_handle.opened_path = zend_string_init(class_file, class_file_len, 0);
}
- opened_path = zend_string_init(file_handle.opened_path, strlen(file_handle.opened_path), 0);
+ opened_path = zend_string_copy(file_handle.opened_path);
ZVAL_NULL(&dummy);
if (zend_hash_add(&EG(included_files), opened_path, &dummy)) {
new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE);