fixed memory leaks in command.c
Merge pull request #196 from pasis/memleaks

Fixed memory leaks in command.c