10000 Issue #1591 · phpredis/phpredis@f52cd23 · GitHub
[go: up one dir, main page]

Skip to content

Commit f52cd23

Browse files
committed
Issue #1591
1 parent 905b641 commit f52cd23

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cluster_library.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,9 +1266,11 @@ PHP_REDIS_API void cluster_disconnect(redisCluster *c, int force TSRMLS_DC) {
12661266

12671267
/* We also want to disconnect any slave connections so they will be pooled
12681268
* in the event we are using persistent connections and connection pooling. */
1269-
ZEND_HASH_FOREACH_PTR(node->slaves, slave) {
1270-
redis_sock_disconnect(slave->sock, force TSRMLS_CC);
1271-
} ZEND_HASH_FOREACH_END();
1269+
if (node->slaves) {
1270+
ZEND_HASH_FOREACH_PTR(node->slaves, slave) {
1271+
redis_sock_disconnect(slave->sock, force TSRMLS_CC);
1272+
} ZEND_HASH_FOREACH_END();
1273+
}
12721274
} ZEND_HASH_FOREACH_END();
12731275
}
12741276

0 commit comments

Comments
 (0)
0