mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	switch-on-connect: Fix warning on discarded const qualifier
pa_modargs_get_value() returns a const string -- instead of discarding the const qualifier, let's just duplicate the string and free it explicitly in the failure case.
This commit is contained in:
		
							parent
							
								
									ad16d77dfe
								
							
						
					
					
						commit
						26a66d103f
					
				
					 1 changed files with 4 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -249,12 +249,10 @@ int pa__init(pa_module*m) {
 | 
			
		|||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    u->blacklist = pa_modargs_get_value(ma, "blacklist", NULL);
 | 
			
		||||
    if (u->blacklist != NULL && pa_is_regex_valid(u->blacklist)) {
 | 
			
		||||
        /* String returned above will be freed with modargs, duplicate it */
 | 
			
		||||
        u->blacklist = pa_xstrdup(u->blacklist);
 | 
			
		||||
    } else if (u->blacklist != NULL) {
 | 
			
		||||
        pa_log_error("A blacklist pattern was provided but is not a valid regex.");
 | 
			
		||||
    u->blacklist = pa_xstrdup(pa_modargs_get_value(ma, "blacklist", NULL));
 | 
			
		||||
    if (u->blacklist != NULL && !pa_is_regex_valid(u->blacklist)) {
 | 
			
		||||
        pa_log_error("A blacklist pattern was provided but is not a valid regex");
 | 
			
		||||
        pa_xfree(u->blacklist);
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue