@@ -1147,23 +1147,21 @@ ra_move_key(const char *key, int key_len, zval *z_from, zval *z_to TSRMLS_DC) {
1147
1147
1148
1148
/* callback with the current progress, with hostname and count */
1149
1149
static void zval_rehash_callback (zend_fcall_info * z_cb , zend_fcall_info_cache * z_cb_cache ,
1150
- const char * hostname , long count TSRMLS_DC ) {
1150
+ const char * hostname , long count , zval * z_ret TSRMLS_DC ) {
1151
1151
1152
1152
zval z_args [2 ];
1153
1153
1154
1154
ZVAL_STRING (& z_args [0 ], hostname );
1155
1155
ZVAL_LONG (& z_args [1 ], count );
1156
1156
1157
1157
#if (PHP_MAJOR_VERSION < 7 )
1158
- zval * z_ret = NULL ,
1159
- * z_host = & z_args [0 ], * z_count = & z_args [1 ],
1158
+ zval * z_host = & z_args [0 ], * z_count = & z_args [1 ],
1160
1159
* * z_args_pp [2 ] = { & z_host , & z_count };
1161
1160
z_cb -> params = z_args_pp ;
1162
1161
z_cb -> retval_ptr_ptr = & z_ret ;
1163
1162
#else
1164
- zval z_ret ;
1165
1163
z_cb -> params = z_args ;
1166
- z_cb -> retval = & z_ret ;
1164
+ z_cb -> retval = z_ret ;
1167
1165
#endif
1168
1166
z_cb -> param_count = 2 ;
1169
1167
z_cb -> no_separation = 0 ;
@@ -1173,18 +1171,16 @@ static void zval_rehash_callback(zend_fcall_info *z_cb, zend_fcall_info_cache *z
1173
1171
1174
1172
/* cleanup */
1175
1173
zval_dtor (& z_args [0 ]);
1176
- zval_ptr_dtor (& z_ret );
1177
1174
}
1178
1175
1179
1176
static void
1180
1177
ra_rehash_server (RedisArray * ra , zval * z_redis , const char * hostname , zend_bool b_index ,
1181
1178
zend_fcall_info * z_cb , zend_fcall_info_cache * z_cb_cache TSRMLS_DC ) {
1182
1179
1183
1180
char * * keys ;
1184
- int * key_lens ;
1185
1181
long count , i ;
1186
- int target_pos ;
1187
- zval * z_target ;
1182
+ int * key_lens , target_pos ;
1183
+ zval * z_target , z_ret ;
1188
1184
1189
1185
/* list all keys */
1190
1186
if (b_index ) {
@@ -1195,7 +1191,8 @@ ra_rehash_server(RedisArray *ra, zval *z_redis, const char *hostname, zend_bool
1195
1191
1196
1192
/* callback */
1197
1193
if (z_cb && z_cb_cache ) {
1198
- zval_rehash_callback (z_cb , z_cb_cache , hostname , count TSRMLS_CC );
1194
+ zval_rehash_callback (z_cb , z_cb_cache , hostname , count , & z_ret TSRMLS_CC );
1195
+ zval_dtor (& z_ret );
1199
1196
}
1200
1197
1201
1198
/* for each key, redistribute */
0 commit comments