Skip to content

Commit 1fb6a24

Browse files
committed
fix 'optional var not initialized' warnings
1 parent 5ee32ba commit 1fb6a24

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

redis.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ PHP_METHOD(Redis, pconnect)
750750
PHP_REDIS_API int redis_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
751751
zval *object, *socket;
752752
char *host = NULL, *persistent_id = NULL;
753-
long port = -1, retry_interval = 0;
753+
zend_long port = -1, retry_interval = 0;
754754
strlen_t host_len, persistent_id_len;
755755
double timeout = 0.0;
756756
RedisSock *redis_sock = NULL;
@@ -2758,7 +2758,7 @@ PHP_METHOD(Redis, slowlog) {
27582758
char *arg, *cmd;
27592759
int cmd_len;
27602760
strlen_t arg_len;
2761-
zend_long option;
2761+
zend_long option = 0;
27622762
enum {SLOWLOG_GET, SLOWLOG_LEN, SLOWLOG_RESET} mode;
27632763

27642764
// Make sure we can get parameters

redis_array.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ PHP_METHOD(RedisArray, _rehash)
551551
{
552552
zval *object;
553553
RedisArray *ra;
554-
zend_fcall_info z_cb;
555-
zend_fcall_info_cache z_cb_cache;
554+
zend_fcall_info z_cb = {0};
555+
zend_fcall_info_cache z_cb_cache = {0};
556556

557557
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|f",
558558
&object, redis_array_ce, &z_cb, &z_cb_cache) == FAILURE) {

redis_cluster.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@ PHP_METHOD(RedisCluster, info) {
27142714
REDIS_REPLY_TYPE rtype;
27152715
char *cmd, *opt=NULL;
27162716
int cmd_len;
2717-
strlen_t opt_len;
2717+
strlen_t opt_len = 0;
27182718
void *ctx = NULL;
27192719
zval *z_arg;
27202720
short slot;
@@ -2766,7 +2766,7 @@ PHP_METHOD(RedisCluster, client) {
27662766
redisCluster *c = GET_CONTEXT();
27672767
char *cmd, *opt=NULL, *arg=NULL;
27682768
int cmd_len;
2769-
strlen_t opt_len, arg_len;
2769+
strlen_t opt_len, arg_len = 0;
27702770
REDIS_REPLY_TYPE rtype;
27712771
zval *z_node;
27722772
short slot;

0 commit comments

Comments
 (0)