Fix heap-use-after-free.
This commit is contained in:
@ -1141,6 +1141,12 @@ void ExecEarlyFreeHashJoin(HashJoinState* node)
|
||||
if (node->hj_HashTable) {
|
||||
ExecHashTableDestroy(node->hj_HashTable);
|
||||
node->hj_HashTable = NULL;
|
||||
/*
|
||||
* HashState.hashtable also point to hj_HashTable(check ExecHashJoin),
|
||||
* so set it to null directly to avoid heap-use-after-free
|
||||
*/
|
||||
HashState* hash_state = (HashState*)innerPlanState(node);
|
||||
hash_state->hashtable = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user