fixed leaks on test_socket