We were failing to initialize conn to NULL and then trying to free it after an error where conn was not initialized. Jeremy has committed my patch to master. However, a back port to 4.1 and 4.0 would be good.
Created attachment 10987 [details] git-am fix for 4.2.next, 4.1.next Richard, please +1 and I'll re-assign to Karolin.
Re-assigning to Karolin for inclusion in 4.1.next, 4.2.next. Jeremy.
Pushed to autobuild-v4-[1|2]-test.
Pushed to both branches. Closing out bug report. Thanks!