aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-01-26 18:43:01 +0900
committerMichael Paquier <michael@paquier.xyz>2021-01-26 18:43:01 +0900
commit7b4c660466dd8a1d25ca316ac02099a7cf0e5896 (patch)
tree5a9b8de365f9eb80d92b355c2577d89dd7a7e922 /contrib/postgres_fdw/postgres_fdw.c
parent0c3fc09fe359a6dc46f1870ceccf60ec60396bc9 (diff)
downloadpostgresql-7b4c660466dd8a1d25ca316ac02099a7cf0e5896.tar.gz
postgresql-7b4c660466dd8a1d25ca316ac02099a7cf0e5896.zip
Fix memory leak when deallocating prepared statement in postgres_fdw
The leak is minor, so no backpatch is done. Oversight in 21734d2. Reported-by: Tom Lane
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 8648be0b810..2ce42ce3f11 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -4063,6 +4063,7 @@ deallocate_query(PgFdwModifyState *fmstate)
if (PQresultStatus(res) != PGRES_COMMAND_OK)
pgfdw_report_error(ERROR, res, fmstate->conn, true, sql);
PQclear(res);
+ pfree(fmstate->p_name);
fmstate->p_name = NULL;
}