fix a couple of memory leaks
Merge pull request #1098 from erysaj/fix-memory-leak

fix a couple of memory leaks