Fixing a memory leak which append when a command is parsed locally