Fix double free
Merge pull request #160 from earada/master

Fix double free