added correct memory leak code and explanation
Merge pull request #22 from htsai010/master

added correct memory leak code and explanation