mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Fixed seg. fault when invalid /etc/asound.conf is found.
This commit is contained in:
		
							parent
							
								
									b36ee47006
								
							
						
					
					
						commit
						3d2f333c6c
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -885,13 +885,11 @@ int snd_config_load(snd_config_t *config, snd_input_t *in)
 | 
				
			||||||
			SNDERR("%s:%d:%d:%s", fd->name ? fd->name : "",
 | 
								SNDERR("%s:%d:%d:%s", fd->name ? fd->name : "",
 | 
				
			||||||
			    fd->line, fd->column, str);
 | 
								    fd->line, fd->column, str);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		snd_config_delete(config);
 | 
					 | 
				
			||||||
		goto _end;
 | 
							goto _end;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (get_char(&input) != EOF) {
 | 
						if (get_char(&input) != EOF) {
 | 
				
			||||||
		SNDERR("%s:%d:%d:Unexpected }", fd->name ? fd->name : "",
 | 
							SNDERR("%s:%d:%d:Unexpected }", fd->name ? fd->name : "",
 | 
				
			||||||
		    fd->line, fd->column);
 | 
							    fd->line, fd->column);
 | 
				
			||||||
		snd_config_delete(config);
 | 
					 | 
				
			||||||
		err = -EINVAL;
 | 
							err = -EINVAL;
 | 
				
			||||||
		goto _end;
 | 
							goto _end;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1898,8 +1896,10 @@ static int parse_args(snd_config_t *subs, const char *str, snd_config_t *defs)
 | 
				
			||||||
			return err;
 | 
								return err;
 | 
				
			||||||
		err = snd_config_load(subs, input);
 | 
							err = snd_config_load(subs, input);
 | 
				
			||||||
		snd_input_close(input);
 | 
							snd_input_close(input);
 | 
				
			||||||
		if (err < 0)
 | 
							if (err < 0) {
 | 
				
			||||||
 | 
								snd_config_delete(subs);
 | 
				
			||||||
			return err;
 | 
								return err;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		snd_config_for_each(i, next, subs) {
 | 
							snd_config_for_each(i, next, subs) {
 | 
				
			||||||
			snd_config_t *n = snd_config_iterator_entry(i);
 | 
								snd_config_t *n = snd_config_iterator_entry(i);
 | 
				
			||||||
			snd_config_t *d;
 | 
								snd_config_t *d;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue