Fix second memory leak. Done by @apique
Merge pull request #178 from Nabellaleen/FixSecondMemoryLeak

Fix second memory leak. Done by @apique