Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit af7e90a

Browse filesBrowse 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 3e60e95 commit af7e90a
Copy full SHA for af7e90a

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎src/include/lib/simplehash.h

Copy file name to clipboardExpand all lines: src/include/lib/simplehash.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,9 @@ SH_STAT(SH_TYPE * tb)
11191119
max_collisions = curcoll;
11201120
}
11211121

1122+
/* large enough to be worth freeing, even if just used for debugging */
1123+
pfree(collisions);
1124+
11221125
if (tb->members > 0)
11231126
{
11241127
fillfactor = tb->members / ((double) tb->size);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.