Fix connection failure segfault