* Also fixes a memory leak spotted by Aokromes (cherry picked from commit 7d3cffc297b6a1e24faf64a19b5167609ad8abbf)