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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Coverity complains about simplehash.h's SH_STAT()
Date: 2024-04-08 01:41:23
Message-ID: 3011033.1712540483@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> 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 that just now. If coverity had started to complain
> after da41d71070d, I'd understand, but that was ~5 years ago.

If we recently added a new simplehash caller, Coverity might see that
as a new bug. Still doesn't explain why nothing about the old callers.
We might have over-hastily dismissed such warnings as uninteresting,
perhaps.

> I can't see a way it could hurt in the back branches, so I'm inclined to
> backpatch the pfree?

+1

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-04-08 01:50:40 Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan
Previous Message Heikki Linnakangas 2024-04-08 01:40:00 Re: Experiments with Postgres and SSL