Re: Coverity complains about simplehash.h's SH_STAT()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-04-08T01:41:23Z
Lists: 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
Commits
-
simplehash: Free collisions array in SH_STAT
- 4b179a472429 12.19 landed
- eabf98e949e3 13.15 landed
- 25ee58e8f26d 14.12 landed
- dcb7cf945c88 15.7 landed
- 974374dcd394 16.3 landed
- af7e90a27786 17.0 landed