diff options
author | patricio.dorantes <patricio@amxiniciativas.com> | 2022-08-03 01:36:54 +0300 |
---|---|---|
committer | patricio.dorantes <patricio@amxiniciativas.com> | 2022-08-03 01:36:54 +0300 |
commit | d1bc672752e4c77dd7a32f8efad5fc5b8efc1291 (patch) | |
tree | 97d20e5444b644cf665802a298786207120a00f0 | |
parent | ed10f365e758787d75b909cff1b677c3028085f4 (diff) |
fix use after free, initialize on NULL
-rw-r--r-- | redis_session.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/redis_session.c b/redis_session.c index 95af257d..df1155c1 100644 --- a/redis_session.c +++ b/redis_session.c @@ -380,7 +380,7 @@ static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_ PS_OPEN_FUNC(redis) { php_url *url; - zval params, *context; + zval params, *context = NULL; int i, j, path_len; redis_pool *pool = ecalloc(1, sizeof(*pool)); @@ -450,8 +450,9 @@ PS_OPEN_FUNC(redis) REDIS_CONF_STRING_STATIC(ht, "prefix", &prefix); REDIS_CONF_AUTH_STATIC(ht, "auth", &user, &pass); - zval_dtor(¶ms); context = REDIS_HASH_STR_FIND_TYPE_STATIC(ht, "stream", IS_ARRAY); + + zval_dtor(¶ms); } if ((url->path == NULL && url->host == NULL) || weight <= 0 || timeout <= 0) { |