> On 24 Apr 2025, at 00:42, Tom Lane <t...@sss.pgh.pa.us> wrote:
> 
> - hashp = (HTAB *) DynaHashAlloc(sizeof(HTAB) + strlen(tabname) + 1);
> + hashp = (HTAB *) MemoryContextAlloc(CurrentDynaHashCxt,
> + sizeof(HTAB) + strlen(tabname) + 1);

This seems correct to me.

While fixing this maybe use MemoryContextAllocZero() instead of subsequent 
MemSet()?

But this might unroll loop of unnecessary beautifications like DynaHashAlloc() 
calling Assert(MemoryContextIsValid(CurrentDynaHashCxt)) just before 
MemoryContextAllocExtended() will repeat same exercise.


Best regards, Andrey Borodin.

Reply via email to