aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-10-29 09:17:34 +0900
committerMichael Paquier <michael@paquier.xyz>2020-10-29 09:17:34 +0900
commit60a51c6b32960822d3987ea7d2816c65bdbcb314 (patch)
tree05601fbb1f46b983f54c1e2c1c65b5f0a3dfb657 /src
parentb787d4ce6d910080065025bcd5f968544997271f (diff)
downloadpostgresql-60a51c6b32960822d3987ea7d2816c65bdbcb314.tar.gz
postgresql-60a51c6b32960822d3987ea7d2816c65bdbcb314.zip
Fix incorrect placement of pfree() in pg_relation_check_pages()
This would cause the function to crash when more than one page is considered as broken and reported in the SRF. Reported-by: Noriyoshi Shinoda Discussion: https://postgr.es/m/TU4PR8401MB11523D42C315AAF822E74275EE170@TU4PR8401MB1152.NAMPRD84.PROD.OUTLOOK.COM
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/pagefuncs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/pagefuncs.c b/src/backend/utils/adt/pagefuncs.c
index b6a23a2a4fa..368ada515cf 100644
--- a/src/backend/utils/adt/pagefuncs.c
+++ b/src/backend/utils/adt/pagefuncs.c
@@ -220,10 +220,10 @@ check_relation_fork(TupleDesc tupdesc, Tuplestorestate *tupstore,
/* Save the corrupted blocks in the tuplestore. */
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
-
- pfree(path);
}
+ pfree(path);
+
/* Pop the error context stack */
error_context_stack = errcallback.previous;
}