mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Fix the error path of snd_pcm_hook_add_conf()
Fixed the segfault in the error path of snd_pcm_hook_add_conf() (calling invalid install_func pointer). Also, added the missing snd_dlclose() to release the handle properly.
This commit is contained in:
		
							parent
							
								
									9c69158f31
								
							
						
					
					
						commit
						9123203f8d
					
				
					 1 changed files with 11 additions and 9 deletions
				
			
		| 
						 | 
					@ -397,16 +397,18 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_
 | 
				
			||||||
       _err:
 | 
					       _err:
 | 
				
			||||||
	if (type)
 | 
						if (type)
 | 
				
			||||||
		snd_config_delete(type);
 | 
							snd_config_delete(type);
 | 
				
			||||||
	if (err >= 0 && args && snd_config_get_string(args, &str) >= 0) {
 | 
						if (err >= 0) {
 | 
				
			||||||
		err = snd_config_search_definition(root, "hook_args", str, &args);
 | 
							if (args && snd_config_get_string(args, &str) >= 0) {
 | 
				
			||||||
		if (err < 0) {
 | 
								err = snd_config_search_definition(root, "hook_args", str, &args);
 | 
				
			||||||
			SNDERR("unknown hook_args %s", str);
 | 
								if (err < 0)
 | 
				
			||||||
		} else {
 | 
									SNDERR("unknown hook_args %s", str);
 | 
				
			||||||
			err = install_func(pcm, args);
 | 
								else
 | 
				
			||||||
 | 
									err = install_func(pcm, args);
 | 
				
			||||||
			snd_config_delete(args);
 | 
								snd_config_delete(args);
 | 
				
			||||||
		}
 | 
							} else
 | 
				
			||||||
	} else
 | 
								err = install_func(pcm, args);
 | 
				
			||||||
		err = install_func(pcm, args);
 | 
							snd_dlclose(h);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if (err < 0)
 | 
						if (err < 0)
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue