fix potential resource leak
Merge pull request #149 from ronnychevalier/rc/fix_potential_leak

fix potential resource leak