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

Commit8469923

Browse files
committed
Fix ancient connection leak in dblink
When using unnamed connections with dblink, every time a newconnection is made, the old one is leaked. Fix that.This has been an issue probably since dblink was first committed.Someone complained almost ten years ago, but apparently I decidednot to pursue it at the time, and neither did anyone else, so itslipped between the cracks. Now that someone else has complained,fix in all supported branches.Discussion: (orig)https://postgr.es/m/flat/F680AB59-6D6F-4026-9599-1BE28880273D%40decibel.org#F680AB59-6D6F-4026-9599-1BE28880273D@decibel.orgDiscussion: (new)https://postgr.es/m/flat/0A3221C70F24FB45833433255569204D1F6ADF8C@G01JPEXMBYT05Reported by: Jim Nasby and Takayuki Tsunakawa
1 parent4cdd81d commit8469923

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎contrib/dblink/dblink.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ dblink_connect(PG_FUNCTION_ARGS)
301301
createNewConnection(connname,rconn);
302302
}
303303
else
304+
{
305+
if (pconn->conn)
306+
PQfinish(pconn->conn);
304307
pconn->conn=conn;
308+
}
305309

306310
PG_RETURN_TEXT_P(cstring_to_text("OK"));
307311
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp