postgres.git / summary / log / commit / refs
commit ec741d48036a4c021ea1071b1e7e42a4ff199c64
Author: Michael Paquier <michael@paquier.xyz>
Date: Thu Feb 27 05:05:58 2025 +0000
First released in: 18.0, 14.18, 15.13, 16.9, 17.5
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 <ranier.vf@gmail.com>
Reviewed-by: vignesh C <vignesh21@gmail.com>
Discussion: https://postgr.es/m/CAEudQArD_nKSnYCNUZiPPsJ2tNXgRmLbXGSOrH1vpOF_XtP0Vg@mail.gmail.com
Discussion: https://postgr.es/m/CAEudQArbTWVSbxq608GRmXJjnNSQ0B6R7CSffNnj2hPWMUsRNg@mail.gmail.com
Backpatch-through: 14
src/bin/pg_amcheck/pg_amcheck.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index 6a83fae6174..9acb6fe8833 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -552,7 +552,7 @@ main(int argc, char *argv[])
executeCommand(conn, install_sql, opts.echo);
pfree(install_sql);
- pfree(schema);
+ PQfreemem(schema);
}
/*
[parent: 6df3be415cdb]