Fix a memory leak in "connect.c" and die if command too long.