Fix some potential memory leak.
Merge pull request #24 from watashi/master

Fix some potential memory leak.