mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Fix connection leak in dblink when dblink_connect() or dblink_connect_u()
end with "duplicate connection name" errors. Backported to release 7.4.
This commit is contained in:
parent
9d1f44113d
commit
63a601457d
@ -2124,9 +2124,14 @@ createNewConnection(const char *name, remoteConn * con)
|
||||
errmsg("out of memory")));
|
||||
|
||||
if (found)
|
||||
{
|
||||
PQfinish(rconn->conn);
|
||||
pfree(rconn);
|
||||
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DUPLICATE_OBJECT),
|
||||
errmsg("duplicate connection name")));
|
||||
}
|
||||
|
||||
hentry->rcon = con;
|
||||
strncpy(hentry->name, name, NAMEDATALEN - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user