From: Michael Paquier Date: Thu, 27 Feb 2025 05:06:00 +0000 (+0900) Subject: pg_amcheck: Fix inconsistency in memory freeing X-Git-Tag: REL_14_18~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35a591a0486fb5527b11ff1878f0ccaa0e672676;p=thirdparty%2Fpostgresql.git pg_amcheck: Fix inconsistency in memory freeing The function in charge of freeing the memory from a result created by PQescapeIdentifier() has to be PQfreemem(), to ensure that both allocation and free come from libpq, but one spot in pg_amcheck was missing that. Oversight in b859d94c6389. Author: Ranier Vilela Reviewed-by: vignesh C Discussion: https://postgr.es/m/CAEudQArD_nKSnYCNUZiPPsJ2tNXgRmLbXGSOrH1vpOF_XtP0Vg@mail.gmail.com Discussion: https://postgr.es/m/CAEudQArbTWVSbxq608GRmXJjnNSQ0B6R7CSffNnj2hPWMUsRNg@mail.gmail.com Backpatch-through: 14 --- diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c index 8ae0d7c77c4..0f5c750cdf6 100644 --- a/src/bin/pg_amcheck/pg_amcheck.c +++ b/src/bin/pg_amcheck/pg_amcheck.c @@ -579,7 +579,7 @@ main(int argc, char *argv[]) executeCommand(conn, install_sql, opts.echo); pfree(install_sql); - pfree(schema); + PQfreemem(schema); } /*