Skip to content

Commit 60a51c6

Browse files
committed
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
1 parent b787d4c commit 60a51c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/pagefuncs.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ check_relation_fork(TupleDesc tupdesc, Tuplestorestate *tupstore,
220220

221221
/* Save the corrupted blocks in the tuplestore. */
222222
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
223-
224-
pfree(path);
225223
}
226224

225+
pfree(path);
226+
227227
/* Pop the error context stack */
228228
error_context_stack = errcallback.previous;
229229
}

0 commit comments

Comments
 (0)