fix memory leaks.
Merge pull request #23 from qmihara/fix-memory-leaks

fix memory leaks.