Fix memory leak on throw
Merge pull request #64 from mscdex/master

Fix memory leak on throw