fix memory leak
Merge pull request #1 from galenzhao/master

fix a memory leak