not closing socket leads to segfault