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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Coverity complains about simplehash.h's SH_STAT()
Дата
Msg-id 3011033.1712540483@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Coverity complains about simplehash.h's SH_STAT()  (Andres Freund <andres@anarazel.de>)
Ответы Re: Coverity complains about simplehash.h's SH_STAT()  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Experiments with Postgres and SSL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Optimizing nbtree ScalarArrayOp execution, allowing multi-column ordered scans, skip scan