mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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
This commit is contained in:
@ -574,8 +574,12 @@ ExecReScanIndexScan(IndexScanState *node)
|
||||
/* flush the reorder queue */
|
||||
if (node->iss_ReorderQueue)
|
||||
{
|
||||
HeapTuple tuple;
|
||||
while (!pairingheap_is_empty(node->iss_ReorderQueue))
|
||||
reorderqueue_pop(node);
|
||||
{
|
||||
tuple = reorderqueue_pop(node);
|
||||
heap_freetuple(tuple);
|
||||
}
|
||||
}
|
||||
|
||||
/* reset index scan */
|
||||
|
Reference in New Issue
Block a user