Fix memory leak
Merge pull request #2 from daguej/leakfix

Fix memory leak