projects
/
postgresql
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac14ba5
)
Fix connection leak in dblink when dblink_connect() or dblink_connect_u()
author
Itagaki Takahiro
<itagaki.takahiro@gmail.com>
Wed, 9 Jun 2010 01:00:13 +0000
(
01:00
+0000)
committer
Itagaki Takahiro
<itagaki.takahiro@gmail.com>
Wed, 9 Jun 2010 01:00:13 +0000
(
01:00
+0000)
end with "duplicate connection name" errors.
Backported to release 7.4.
contrib/dblink/dblink.c
patch
|
blob
|
history
diff --git
a/contrib/dblink/dblink.c
b/contrib/dblink/dblink.c
index 16f502008183ea5adc0af817e6000bb5de5ff565..f67128e7519d70b408f9024e0b5781775f80590c 100644
(file)
--- a/
contrib/dblink/dblink.c
+++ b/
contrib/dblink/dblink.c
@@
-2151,9
+2151,14
@@
createNewConnection(const char *name, remoteConn * rconn)
HASH_ENTER, &found);
if (found)
+ {
+ PQfinish(rconn->conn);
+ pfree(rconn);
+
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("duplicate connection name")));
+ }
hentry->rconn = rconn;
strncpy(hentry->name, name, NAMEDATALEN - 1);