Thanks for the response,
Any Postgres function to check if CurTransactionContext is valid or not?
Did you mean TopTransactionContext?
As of now, we don't free our dlist. We solely depend on Postgres to free our dlist while it frees the TopTransactionContext. But if we do allocate in TopMemoryContext, we need to take care of freeing our allocations.
And one more issue is, we found this bug once in all the testing we did. So trying to replay this bug seems very difficult.
Regards,
G. Sai Ram