diff options
author | Joe Conway <mail@joeconway.com> | 2009-09-12 23:20:52 +0000 |
---|---|---|
committer | Joe Conway <mail@joeconway.com> | 2009-09-12 23:20:52 +0000 |
commit | d6119d8091b1bae568fd9083268ea392ccb2d939 (patch) | |
tree | 30ba7858ec9562558a10508d0f5654ba0242686a | |
parent | 4ab6ebf3f4dc8182556dc23c49ee59e602a78f1c (diff) | |
download | postgresql-d6119d8091b1bae568fd9083268ea392ccb2d939.tar.gz postgresql-d6119d8091b1bae568fd9083268ea392ccb2d939.zip |
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 by
Tatsuhito Kasahara. Introduced in 8.4.
-rw-r--r-- | contrib/dblink/dblink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index ccf8cb2a87d..61585644f92 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -8,7 +8,7 @@ * Darko Prenosil <Darko.Prenosil@finteh.hr> * Shridhar Daithankar <shridhar_daithankar@persistent.co.in> * - * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.83 2009/08/05 16:11:07 joe Exp $ + * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.84 2009/09/12 23:20:52 joe Exp $ * Copyright (c) 2001-2009, PostgreSQL Global Development Group * ALL RIGHTS RESERVED; * @@ -855,9 +855,9 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async) (PQresultStatus(res) != PGRES_COMMAND_OK && PQresultStatus(res) != PGRES_TUPLES_OK)) { - dblink_res_error(conname, res, "could not execute query", fail); if (freeconn) PQfinish(conn); + dblink_res_error(conname, res, "could not execute query", fail); MemoryContextSwitchTo(oldcontext); SRF_RETURN_DONE(funcctx); } |