From 7b4c660466dd8a1d25ca316ac02099a7cf0e5896 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 26 Jan 2021 18:43:01 +0900 Subject: 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 --- contrib/postgres_fdw/postgres_fdw.c | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/postgres_fdw/postgres_fdw.c') 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; } -- cgit v1.2.3