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

Skip to content

Commit 564ce3a

Browse files
yatsukhnenkomichael-grunder
authored andcommitted
RedisArray segfault fix
1 parent 645888b commit 564ce3a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

redis_array_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ ra_make_array(HashTable *hosts, zval *z_fun, zval *z_dist, HashTable *hosts_prev
350350
ra->pconnect = b_pconnect;
351351
ra->connect_timeout = connect_timeout;
352352

353-
if (ra_load_hosts(ra, hosts, retry_interval, b_lazy_connect TSRMLS_CC) == NULL) {
353+
if (ra_load_hosts(ra, hosts, retry_interval, b_lazy_connect TSRMLS_CC) == NULL || !ra->count) {
354354
for (i = 0; i < ra->count; ++i) {
355355
zval_dtor(&ra->redis[i]);
356356
efree(ra->hosts[i]);

0 commit comments

Comments
 (0)