Fix memory leak in IndexScan node with reordering

Alexander Korotkov <akorotkov@postgresql.org>

Commit: 7a12a9e3cc9784d5eeeb58b6b35ef2e735516a99
Author: Alexander Korotkov <akorotkov@postgresql.org>
Date: 2022-02-14T00:32:39Z
Releases: 12.11
Fix memory leak in IndexScan node with reordering

Fix ExecReScanIndexScan() to free the referenced tuples while emptying the
priority queue.  Backpatch to all supported versions.

Discussion: https://postgr.es/m/CAHqSB9gECMENBQmpbv5rvmT3HTaORmMK3Ukg73DsX5H7EJV7jw%40mail.gmail.com
Author: Aliaksandr Kalenik
Reviewed-by: Tom Lane, Alexander Korotkov
Backpatch-through: 10

Files

Discussion