fixed memory leaks
Merge pull request #8 from yyjim/fix_memory_leak

fixed memory leaks