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

Skip to content

Commit d1bc672

Browse files
author
patricio.dorantes
committed
fix use after free, initialize on NULL
1 parent ed10f36 commit d1bc672

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

redis_session.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_
380380
PS_OPEN_FUNC(redis)
381381
{
382382
php_url *url;
383-
zval params, *context;
383+
zval params, *context = NULL;
384384
int i, j, path_len;
385385

386386
redis_pool *pool = ecalloc(1, sizeof(*pool));
@@ -450,8 +450,9 @@ PS_OPEN_FUNC(redis)
450450
REDIS_CONF_STRING_STATIC(ht, "prefix", &prefix);
451451
REDIS_CONF_AUTH_STATIC(ht, "auth", &user, &pass);
452452

453-
zval_dtor(&params);
454453
context = REDIS_HASH_STR_FIND_TYPE_STATIC(ht, "stream", IS_ARRAY);
454+
455+
zval_dtor(&params);
455456
}
456457

457458
if ((url->path == NULL && url->host == NULL) || weight <= 0 || timeout <= 0) {

0 commit comments

Comments
 (0)