Fixed small memory leak
Support connections from ipv6 and ipv4