mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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-
This commit is contained in:
		@@ -1101,6 +1101,9 @@ SH_STAT(SH_TYPE * tb)
 | 
			
		||||
			max_collisions = curcoll;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* large enough to be worth freeing, even if just used for debugging */
 | 
			
		||||
	pfree(collisions);
 | 
			
		||||
 | 
			
		||||
	if (tb->members > 0)
 | 
			
		||||
	{
 | 
			
		||||
		fillfactor = tb->members / ((double) tb->size);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user