From: Michael Paquier Date: Tue, 26 Jan 2021 09:43:01 +0000 (+0900) Subject: Fix memory leak when deallocating prepared statement in postgres_fdw X-Git-Tag: REL_14_BETA1~876 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b4c660466dd8a1d25ca316ac02099a7cf0e5896;p=thirdparty%2Fpostgresql.git 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 --- 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; }