doc: fix leak in example.
doc: add example for executing a command.