Fix of a memory leak

Modification done by @apique (Pull request done in his place to avoid him the setup of a working github workspace ^^)