Fixed segfault resulting from trying to free the wrong address while parsing a command