Tl other leaks

Dear Martin,

While I had fired the memory checker to identify the previous leak, I have found a couple of additional leaks. Those are not as dramatic, but I think they can definitely help when loading new docs repeatedly.

Best regards,

Timothée