Skip to content

Commit b7f9df7

Browse files
yatsukhnenkomichael-grunder
authored andcommitted
Sanity check for redis_sock->stream before closing.
1 parent 460c8f2 commit b7f9df7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,8 +1892,9 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock)
18921892
if (redis_sock_check_liveness(redis_sock) == SUCCESS) {
18931893
redis_sock->status = REDIS_SOCK_STATUS_CONNECTED;
18941894
return SUCCESS;
1895+
} else if (redis_sock->stream) {
1896+
php_stream_pclose(redis_sock->stream);
18951897
}
1896-
php_stream_pclose(redis_sock->stream);
18971898
p->nb_active--;
18981899
}
18991900

0 commit comments

Comments
 (0)