Re: Coverity complains about simplehash.h's SH_STAT()

2024-04-07 Thread Andres Freund
On 2024-04-07 21:41:23 -0400, Tom Lane wrote: > Andres Freund writes: > > I can't see a way it could hurt in the back branches, so I'm inclined to > > backpatch the pfree? > > +1 Done

Re: Coverity complains about simplehash.h's SH_STAT()

2024-04-07 Thread Tom Lane
Andres Freund writes: > On 2024-04-07 21:03:53 -0400, Tom Lane wrote: >> I realize this function is only debug support, but wouldn't it >> be appropriate to pfree(collisions) before exiting? > It indeed looks like that memory should be freed. Very odd that coverity > started to complain about tha

Re: Coverity complains about simplehash.h's SH_STAT()

2024-04-07 Thread Andres Freund
Hi, On 2024-04-07 21:03:53 -0400, Tom Lane wrote: > Today's Coverity run produced this: > > /srv/coverity/git/pgsql-git/postgresql/src/include/lib/simplehash.h: 1138 in > bh_nodeidx_stat() > 1132 avg_collisions = 0; > 1133 } > 1134 > 1135 sh_log("size: " UINT64_F

Coverity complains about simplehash.h's SH_STAT()

2024-04-07 Thread Tom Lane
Today's Coverity run produced this: /srv/coverity/git/pgsql-git/postgresql/src/include/lib/simplehash.h: 1138 in bh_nodeidx_stat() 1132 avg_collisions = 0; 1133 } 1134 1135 sh_log("size: " UINT64_FORMAT ", members: %u, filled: %f, total chain: %u, max chain: %u,