@@ -585,12 +585,13 @@ PHP_METHOD(Redis, __construct)
585
585
Public Destructor
586
586
*/
587
587
PHP_METHOD (Redis ,__destruct ) {
588
+ RedisSock * redis_sock ;
589
+
588
590
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "" ) == FAILURE ) {
589
591
RETURN_FALSE ;
590
592
}
591
593
592
594
// Grab our socket
593
- RedisSock * redis_sock ;
594
595
if (redis_sock_get (getThis (), & redis_sock TSRMLS_CC , 1 ) < 0 ) {
595
596
RETURN_FALSE ;
596
597
}
@@ -3898,6 +3899,8 @@ PHP_METHOD(Redis, zAdd) {
3898
3899
zval * * z_args ;
3899
3900
int argc = ZEND_NUM_ARGS (), i ;
3900
3901
3902
+ smart_str buf = {0 };
3903
+
3901
3904
/* get redis socket */
3902
3905
if (redis_sock_get (getThis (), & redis_sock TSRMLS_CC , 0 ) < 0 ) {
3903
3906
RETURN_FALSE ;
@@ -3924,7 +3927,6 @@ PHP_METHOD(Redis, zAdd) {
3924
3927
key_free = redis_key_prefix (redis_sock , & key , & key_len TSRMLS_CC );
3925
3928
3926
3929
/* start building the command */
3927
- smart_str buf = {0 };
3928
3930
smart_str_appendc (& buf , '*' );
3929
3931
smart_str_append_long (& buf , argc + 1 ); /* +1 for ZADD command */
3930
3932
smart_str_appendl (& buf , _NL , sizeof (_NL ) - 1 );
@@ -4471,6 +4473,7 @@ PHPAPI void generic_z_command(INTERNAL_FUNCTION_PARAMETERS, char *command, int c
4471
4473
HashPosition ptr ;
4472
4474
char * store_key , * agg_op = NULL ;
4473
4475
int cmd_arg_count = 2 , store_key_len , agg_op_len = 0 , keys_count ;
4476
+ int key_free ;
4474
4477
4475
4478
// Grab our parameters
4476
4479
if (zend_parse_method_parameters (ZEND_NUM_ARGS () TSRMLS_CC , getThis (), "Osa|a!s" ,
@@ -4529,7 +4532,7 @@ PHPAPI void generic_z_command(INTERNAL_FUNCTION_PARAMETERS, char *command, int c
4529
4532
redis_cmd_init_sstr (& cmd , cmd_arg_count , command , command_len );
4530
4533
4531
4534
// Prefix our key if necessary and add the output key
4532
- int key_free = redis_key_prefix (redis_sock , & store_key , & store_key_len TSRMLS_CC );
4535
+ key_free = redis_key_prefix (redis_sock , & store_key , & store_key_len TSRMLS_CC );
4533
4536
redis_cmd_append_sstr (& cmd , store_key , store_key_len );
4534
4537
if (key_free ) efree (store_key );
4535
4538
@@ -5630,9 +5633,9 @@ PHPAPI void generic_subscribe_cmd(INTERNAL_FUNCTION_PARAMETERS, char *sub_cmd)
5630
5633
/* Multibulk Response, format : {message type, originating channel, message payload} */
5631
5634
while (1 ) {
5632
5635
/* call the callback with this z_tab in argument */
5636
+ int is_pmsg , tab_idx = 1 ;
5633
5637
zval * * type , * * channel , * * pattern , * * data ;
5634
5638
z_tab = redis_sock_read_multibulk_reply_zval (INTERNAL_FUNCTION_PARAM_PASSTHRU , redis_sock );
5635
- int is_pmsg , tab_idx = 1 ;
5636
5639
5637
5640
if (z_tab == NULL || Z_TYPE_P (z_tab ) != IS_ARRAY ) {
5638
5641
//ERROR
0 commit comments