fixed possible memory leak
Merge pull request #1 from aharter/memleak

fixed possible memory leak