Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit71dca6e

Browse files
committed
Fix connection leak in dblink when dblink_connect() or dblink_connect_u()
end with "duplicate connection name" errors.Backported to release 7.4.
1 parent9f3cf8a commit71dca6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎contrib/dblink/dblink.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,9 +1980,14 @@ createNewConnection(const char *name, remoteConn * con)
19801980
errmsg("out of memory")));
19811981

19821982
if (found)
1983+
{
1984+
PQfinish(rconn->conn);
1985+
pfree(rconn);
1986+
19831987
ereport(ERROR,
19841988
(errcode(ERRCODE_DUPLICATE_OBJECT),
19851989
errmsg("duplicate connection name")));
1990+
}
19861991

19871992
hentry->rcon=con;
19881993
strncpy(hentry->name,name,NAMEDATALEN-1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp