Fix code format violation
Print IPv6 addresses with surrounding []s
Bug fix---forgot to free memory.