mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Fix small memory leaks in GUC checks
Follow-up commit to a9d58bfe8a.  Backpatch down to v16 where
this was added in order to keep the code consistent for future
backpatches.
Author: Tofig Aliev <t.aliev@postgrespro.ru>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/bba4313fdde9db46db279f96f3b748b1@postgrespro.ru
Backpatch-through: 16
			
			
This commit is contained in:
		@@ -1082,6 +1082,8 @@ check_application_name(char **newval, void **extra, GucSource source)
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	guc_free(*newval);
 | 
			
		||||
 | 
			
		||||
	pfree(clean);
 | 
			
		||||
	*newval = ret;
 | 
			
		||||
	return true;
 | 
			
		||||
@@ -1118,6 +1120,8 @@ check_cluster_name(char **newval, void **extra, GucSource source)
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	guc_free(*newval);
 | 
			
		||||
 | 
			
		||||
	pfree(clean);
 | 
			
		||||
	*newval = ret;
 | 
			
		||||
	return true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user