Use strdup() instead of malloc() + strcpy()
Implement cmd_submit