Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4377c97

Browse files
committed
1 parent 0a886fe commit 4377c97

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

redis_cluster.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -2994,13 +2994,13 @@ PHP_METHOD(RedisCluster, rawcommand) {
29942994
short slot;
29952995

29962996
/* Sanity check on our arguments */
2997-
z_args = emalloc(argc * sizeof(zval));
29982997
if (argc < 2) {
29992998
php_error_docref(NULL TSRMLS_CC, E_WARNING,
30002999
"You must pass at least node information as well as at least a command.");
3001-
efree(z_args);
30023000
RETURN_FALSE;
3003-
} else if (zend_get_parameters_array(ht, argc, z_args) == FAILURE) {
3001+
}
3002+
z_args = emalloc(argc * sizeof(zval));
3003+
if (zend_get_parameters_array(ht, argc, z_args) == FAILURE) {
30043004
php_error_docref(NULL TSRMLS_CC, E_WARNING,
30053005
"Internal PHP error parsing method parameters.");
30063006
efree(z_args);
@@ -3022,7 +3022,6 @@ PHP_METHOD(RedisCluster, rawcommand) {
30223022
zend_throw_exception(redis_cluster_exception_ce,
30233023
"Unable to send command to the specified node", 0 TSRMLS_CC);
30243024
efree(cmd);
3025-
efree(z_args);
30263025
RETURN_FALSE;
30273026
}
30283027

0 commit comments

Comments
 (0)