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

Skip to content

Commit 2c907f2

Browse files
committed
redis.c:5412:3: warning: 'callback_type', 'callback_ft_name_len', 'callback_ft_name' may be used uninitialized in this function
1 parent 31b3840 commit 2c907f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

redis.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5288,7 +5288,7 @@ PHP_METHOD(Redis, subscribe)
52885288
zval *z_tab, **tmp;
52895289
char *type_response;
52905290

5291-
int callback_type;
5291+
int callback_type = 0;
52925292
zval *z_o, *z_fun = NULL,*z_ret, *z_args[3];
52935293
char *method_name;
52945294

@@ -5376,6 +5376,8 @@ PHP_METHOD(Redis, subscribe)
53765376
callback_ft_name = Z_STRVAL_P(z_callback);
53775377
callback_ft_name_len = strlen(callback_ft_name);
53785378
callback_type = R_SUB_CALLBACK_FT_TYPE;
5379+
MAKE_STD_ZVAL(z_fun);
5380+
ZVAL_STRINGL(z_fun, callback_ft_name, callback_ft_name_len, 0);
53795381
}
53805382

53815383
/* Multibulk Response, format : {message type, originating channel, message payload} */
@@ -5416,8 +5418,6 @@ PHP_METHOD(Redis, subscribe)
54165418

54175419
case R_SUB_CALLBACK_FT_TYPE:
54185420
MAKE_STD_ZVAL(z_ret);
5419-
MAKE_STD_ZVAL(z_fun);
5420-
ZVAL_STRINGL(z_fun, callback_ft_name, callback_ft_name_len, 0);
54215421
call_user_function(EG(function_table), NULL, z_fun, z_ret, 3, z_args TSRMLS_CC);
54225422
efree(z_fun);
54235423
efree(z_ret);

0 commit comments

Comments
 (0)