summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-02-25 15:47:24 +0800
committerXinchen Hui <laruence@gmail.com>2014-02-25 15:47:24 +0800
commit71dac3d54f8c3dd80d5669846601a6980a7c3067 (patch)
treef6ab7ec7d1a2d5a5a83eef9114a548413b3c79c3 /ext/spl/php_spl.c
parentbfcb3defdda99345e42cfa2988f6312fdfc5b7ed (diff)
downloadphp-git-71dac3d54f8c3dd80d5669846601a6980a7c3067.tar.gz
Don't add_ref in add_*_str functions
Diffstat (limited to 'ext/spl/php_spl.c')
-rw-r--r--ext/spl/php_spl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 90d4e2f054..26f39eb513 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -744,18 +744,18 @@ PHP_FUNCTION(spl_autoload_functions)
Z_ADDREF_P(alfi->obj);
add_next_index_zval(&tmp, alfi->obj);
} else {
- add_next_index_str(&tmp, alfi->ce->name);
+ add_next_index_str(&tmp, STR_COPY(alfi->ce->name));
}
- add_next_index_str(&tmp, alfi->func_ptr->common.function_name);
+ add_next_index_str(&tmp, STR_COPY(alfi->func_ptr->common.function_name));
add_next_index_zval(return_value, &tmp);
} else {
if (strncmp(alfi->func_ptr->common.function_name->val, "__lambda_func", sizeof("__lambda_func") - 1)) {
- add_next_index_str(return_value, alfi->func_ptr->common.function_name);
+ add_next_index_str(return_value, STR_COPY(alfi->func_ptr->common.function_name));
} else {
zend_string *key;
ulong dummy;
zend_hash_get_current_key_ex(SPL_G(autoload_functions), &key, &dummy, 0, &function_pos);
- add_next_index_str(return_value, key);
+ add_next_index_str(return_value, STR_COPY(key));
}
}
@@ -765,7 +765,7 @@ PHP_FUNCTION(spl_autoload_functions)
}
array_init(return_value);
- add_next_index_str(return_value, EG(autoload_func)->common.function_name);
+ add_next_index_str(return_value, STR_COPY(EG(autoload_func)->common.function_name));
} /* }}} */
/* {{{ proto string spl_object_hash(object obj)