I pushed a patch to fix the leak -- it is in master branch 79459d3
If you test it and report it solves the leak, I will backport.
For the crash, not sure it is related, can you get the output in gdb for the next commands?
frame 4
p *cmd
—
Reply to this email directly or view it on GitHub.