Plug the main leak, found by Myrsloik

It still leaks a bit, maybe one megabyte per script (re)load.