Fix heap-use-after-free.

This commit is contained in:
totaj
2023-03-25 11:03:30 +08:00
parent ce357b14c9
commit 223b1d8f9b

View File

@ -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;
}
/*