Fix a possible memory leak
Merge pull request #431 from leeroy2098/merge

Fix a possible memory leak