mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	ucm: libconfig parser - fix memory leaks
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									4522e2008f
								
							
						
					
					
						commit
						b2b3658fb9
					
				
					 1 changed files with 3 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -457,7 +457,7 @@ static int parse_libconfig1(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
 | 
			
		|||
				return err;
 | 
			
		||||
			err = uc_mgr_substitute_tree(uc_mgr, cfg);
 | 
			
		||||
			if (err < 0) {
 | 
			
		||||
				snd_config_delete(config);
 | 
			
		||||
				snd_config_delete(cfg);
 | 
			
		||||
				return err;
 | 
			
		||||
			}
 | 
			
		||||
			err = snd_config_merge(uc_mgr->local_config, cfg, 1);
 | 
			
		||||
| 
						 | 
				
			
			@ -480,17 +480,13 @@ static int parse_libconfig1(snd_use_case_mgr_t *uc_mgr, snd_config_t *cfg)
 | 
			
		|||
	if (config) {
 | 
			
		||||
		if (substconfig) {
 | 
			
		||||
			err = uc_mgr_substitute_tree(uc_mgr, config);
 | 
			
		||||
			if (err < 0) {
 | 
			
		||||
				snd_config_delete(config);
 | 
			
		||||
			if (err < 0)
 | 
			
		||||
				return err;
 | 
			
		||||
		}
 | 
			
		||||
		}
 | 
			
		||||
		err = snd_config_merge(uc_mgr->local_config, config, 1);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_config_delete(config);
 | 
			
		||||
		if (err < 0)
 | 
			
		||||
			return err;
 | 
			
		||||
	}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue