fix bug for memory leak while adding common files
Merge pull request #22 from yifei429/master

fix bug for memory leak while adding common files