Skip to content

Commit 974374d

Browse files
committed
simplehash: Free collisions array in SH_STAT
While SH_STAT() is only used for debugging, the allocated array can be large, and therefore should be freed. It's unclear why coverity started warning now. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Reported-by: Coverity Discussion: https://postgr.es/m/3005248.1712538233@sss.pgh.pa.us Backpatch: 12-
1 parent a690920 commit 974374d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/include/lib/simplehash.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,9 @@ SH_STAT(SH_TYPE * tb)
11011101
max_collisions = curcoll;
11021102
}
11031103

1104+
/* large enough to be worth freeing, even if just used for debugging */
1105+
pfree(collisions);
1106+
11041107
if (tb->members > 0)
11051108
{
11061109
fillfactor = tb->members / ((double) tb->size);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy