mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pipewire: allow NULL pointers in pw_properties_free()
Just like the real free() we should just ignore a NULL pointer, makes the caller code easier for those instances where properties are optional. Patch generated with concinelle with a few manual fixes.
This commit is contained in:
		
							parent
							
								
									a1e821c259
								
							
						
					
					
						commit
						e0471c6757
					
				
					 68 changed files with 142 additions and 273 deletions
				
			
		| 
						 | 
				
			
			@ -307,10 +307,8 @@ static void impl_destroy(struct impl *impl)
 | 
			
		|||
		pw_stream_destroy(impl->playback);
 | 
			
		||||
	if (impl->core && impl->do_disconnect)
 | 
			
		||||
		pw_core_disconnect(impl->core);
 | 
			
		||||
	if (impl->capture_props)
 | 
			
		||||
		pw_properties_free(impl->capture_props);
 | 
			
		||||
	if (impl->playback_props)
 | 
			
		||||
		pw_properties_free(impl->playback_props);
 | 
			
		||||
	pw_properties_free(impl->capture_props);
 | 
			
		||||
	pw_properties_free(impl->playback_props);
 | 
			
		||||
	pw_work_queue_cancel(impl->work, impl, SPA_ID_INVALID);
 | 
			
		||||
	free(impl);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -473,8 +471,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
 | 
			
		|||
	return 0;
 | 
			
		||||
 | 
			
		||||
error:
 | 
			
		||||
	if (props)
 | 
			
		||||
		pw_properties_free(props);
 | 
			
		||||
	pw_properties_free(props);
 | 
			
		||||
	impl_destroy(impl);
 | 
			
		||||
	return res;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue