As you can see, there are no other pointers working with this block of memory,
You can see this line?
sortnscolumns = (ParseNamespaceColumn *) palloc0
All allocations in the backend occur at Context memory managers.
Resource leak can occur mainly with TopTransactionContext.
and all operations above are either read-only or append nodes to the lists. If I am mistaken, please correct me. Furthermore, I will call `list_free` immediately after `addRangeTableEntryForJoin()`. The new patch is attached.
This style is not recommended.
You prevent the use of colnames after calling addRangeTableEntryForJoin.
Better free at the end of the function, like 0002.
Tip 0001, 0002, 0003 numerations are to different patchs.