Skip to content

Commit 0acaa06

Browse files
committed
call_function always initialized retval
1 parent d67517b commit 0acaa06

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

php_memcached.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -613,13 +613,7 @@ memcached_return php_memc_result_apply(php_memc_object_t *intern, php_memc_resul
613613
const char *res_key;
614614
size_t res_key_len;
615615

616-
617-
ZVAL_UNDEF(&zv_value);
618616
if (!s_memcached_result_to_zval(intern->memc, &result, &zv_value)) {
619-
if (Z_TYPE(zv_value) != IS_UNDEF) {
620-
zval_ptr_dtor(&zv_value);
621-
}
622-
623617
if (EG(exception)) {
624618
status = MEMC_RES_PAYLOAD_FAILURE;
625619
memcached_quit(intern->memc);
@@ -729,8 +723,6 @@ zend_bool s_invoke_new_instance_cb(zval *object, zend_fcall_info *fci, zend_fcal
729723
ZVAL_NULL(&id);
730724
}
731725

732-
ZVAL_UNDEF(&retval);
733-
734726
zend_fcall_info_argn(fci, 2, object, &id);
735727
fci->retval = &retval;
736728
fci->no_separation = 1;
@@ -784,8 +776,6 @@ zend_bool s_invoke_cache_callback(zval *zobject, zend_fcall_info *fci, zend_fcal
784776
fci->params = params;
785777
fci->param_count = 4;
786778

787-
ZVAL_UNDEF(&retval);
788-
789779
if (zend_call_function(fci, fcc) == SUCCESS) {
790780
if (zend_is_true(&retval)) {
791781
time_t expiration = zval_get_long(Z_REFVAL(ref_expiration));
@@ -1596,7 +1586,6 @@ zend_bool s_result_callback_apply(php_memc_object_t *intern, zend_string *key, z
15961586
context->fci.retval = &retval;
15971587
context->fci.param_count = 2;
15981588

1599-
ZVAL_UNDEF(&retval);
16001589
if (zend_call_function(&context->fci, &context->fcc) == FAILURE) {
16011590
if (Z_TYPE(retval) != IS_UNDEF) {
16021591
zval_ptr_dtor(&retval);
@@ -3597,14 +3586,10 @@ zend_bool s_memcached_result_to_zval(memcached_st *memc, memcached_result_st *re
35973586

35983587
default:
35993588
php_error_docref(NULL, E_WARNING, "unknown payload type");
3600-
retval = 0;
36013589
break;
36023590
}
36033591
zend_string_release(data);
36043592

3605-
if (!retval) {
3606-
zval_ptr_dtor(return_value);
3607-
}
36083593
return retval;
36093594
}
36103595

0 commit comments

Comments
 (0)