visionmedia/commander.c — pull request #4 by deltheil (2012-12-13 14:38:26+00:00)
Title: Memory leak & invalid write fixes

The large option and optional argument are allocated dynamically per `command_option_t` structure. They must be freed up after use. I've added a dedicated `command_clean` function for that purpose.

Also, `large` and `argname` are manipulated as character strings. So we must allocate an extra-space for the null terminator (`strlen` does not include such terminator).