summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson2025-02-24 15:03:19 +0000
committerDaniel Gustafsson2025-02-24 15:03:19 +0000
commite889422d98e066dcf095fa275fbcb14ffd45708c (patch)
tree1216f911c6271590672b70611de61c9d210f390f
parent5ee75e32fa734e8ae85ff096f1523be8e16e1b8d (diff)
pg_amcheck: PQclear query results
While the potential memory leak is small, ensure to PQclear the query results before disconnecting. Author: Jiao Shuntian <[email protected]> Reviewed-by: Daniel Gustafsson <[email protected]> Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/bin/pg_amcheck/pg_amcheck.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/pg_amcheck/pg_amcheck.c b/src/bin/pg_amcheck/pg_amcheck.c
index c5ec25be22b..996833ed400 100644
--- a/src/bin/pg_amcheck/pg_amcheck.c
+++ b/src/bin/pg_amcheck/pg_amcheck.c
@@ -587,6 +587,7 @@ main(int argc, char *argv[])
/* Querying the catalog succeeded, but amcheck is missing. */
pg_log_warning("skipping database \"%s\": amcheck is not installed",
PQdb(conn));
+ PQclear(result);
disconnectDatabase(conn);
conn = NULL;
continue;