Fix a memleak
Merge pull request #800 from jvoisin/patch-2

Fix a memleak