The fixes will free up resources (file handles, database handles, allocated memory) cleanly on error.
Created attachment 12333 [details]
Patch for 4.5rc
Please apply to 4.5 before BZ12122 - applying in BZ number order is easiest :-)
Here are patches for v4-5.
(In reply to Amitay Isaacs from comment #3)
Pushed to autobuild-v4-5-test.
(In reply to Karolin Seeger from comment #4)
Pushed to v4-5-test.
Closing out bug report.