Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2016-11-13 00:10:16 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2016-11-13 15:23:18 +0300
commit843128386fc25005495af2ad8b324c06f918d7a9 (patch)
tree0bbb15708d137a9702319c988f4bb0b4e4c14851 /cluster_library.c
parent3b147cbacd14c7937c543cdee2e67c6c434843ff (diff)
php7 compatibility
zval_ptr_dtor
Diffstat (limited to 'cluster_library.c')
-rw-r--r--cluster_library.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/cluster_library.c b/cluster_library.c
index 8ac9971f..2b3a31b7 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -1642,7 +1642,7 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *
void *ctx)
{
subscribeContext *sctx = (subscribeContext*)ctx;
- zval z_tab, *z_tmp, *z_ret;
+ zval z_tab, *z_tmp;
int pull=0;
@@ -1669,11 +1669,11 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *
// Set up our callback pointers
#if (PHP_MAJOR_VERSION < 7)
- zval **z_args[4];
+ zval *z_ret, **z_args[4];
sctx->cb.retval_ptr_ptr = &z_ret;
#else
- zval z_args[4];
- sctx->cb.retval = z_ret;
+ zval z_ret, z_args[4];
+ sctx->cb.retval = &z_ret;
#endif
sctx->cb.params = z_args;
sctx->cb.no_separation = 0;
@@ -1753,7 +1753,7 @@ PHP_REDIS_API void cluster_sub_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *
}
// If we have a return value, free it
- if(z_ret) zval_ptr_dtor(&z_ret);
+ zval_ptr_dtor(&z_ret);
zval_dtor(&z_tab);
}
@@ -1941,7 +1941,10 @@ PHP_REDIS_API void cluster_gen_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
/* Call our specified callback */
if (cb(c->cmd_sock, z_result, c->reply_len, ctx TSRMLS_CC)==FAILURE) {
- zval_ptr_dtor(z_result);
+ zval_dtor(z_result);
+#if (PHP_MAJOR_VERSION < 7)
+ efree(z_result);
+#endif
CLUSTER_RETURN_FALSE(c);
}
}