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

Commitd6119d8

Browse files
committed
plug dblink resource leak
dblink generates orphaned connections when called with a connection string,fail_on_error = true, and an ERROR occurs. Discovery and patch byTatsuhito Kasahara. Introduced in 8.4.
1 parent4ab6ebf commitd6119d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎contrib/dblink/dblink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.83 2009/08/05 16:11:07 joe Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.84 2009/09/12 23:20:52 joe Exp $
1212
* Copyright (c) 2001-2009, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -855,9 +855,9 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
855855
(PQresultStatus(res)!=PGRES_COMMAND_OK&&
856856
PQresultStatus(res)!=PGRES_TUPLES_OK))
857857
{
858-
dblink_res_error(conname,res,"could not execute query",fail);
859858
if (freeconn)
860859
PQfinish(conn);
860+
dblink_res_error(conname,res,"could not execute query",fail);
861861
MemoryContextSwitchTo(oldcontext);
862862
SRF_RETURN_DONE(funcctx);
863863
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp