Connection leak in dblink on duplicate names

Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>

From: Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Date: 2010-06-08T06:25:16Z
Lists: pgsql-hackers

Attachments

I found contrib/dblink leaks a connection or a small amout of memory
when dblink_connect() ends with a duplicate connection name error.
We should disconnect the connection before raise any ERRORs.

Patch attached.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center