Clean up data conversion short-lived memory context.
authorJoe Conway <mail@joeconway.com>
Fri, 20 Jun 2014 19:22:50 +0000 (12:22 -0700)
committerJoe Conway <mail@joeconway.com>
Fri, 20 Jun 2014 19:26:43 +0000 (12:26 -0700)
commitb3a3f3d2f437922258371aee78c587b3f774b992
treed8d43ed859ab3e4317a1425de88b89648fdfcd78
parent46c450c0b04471fc52602520c0a436bda42a3c0d
Clean up data conversion short-lived memory context.

dblink uses a short-lived data conversion memory context. However it
was not deleted when no longer needed, leading to a noticeable memory
leak under some circumstances. Plug the hole, along with minor
refactoring. Backpatch to 9.2 where the leak was introduced.

Report and initial patch by MauMau. Reviewed/modified slightly by
Tom Lane and me.
contrib/dblink/dblink.c