mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	module-bluez5-discover: avoid use after free on de-init
Hashmap loaded_device_paths contain objects holding keys to entries, and these objects must be alive while map is emptied. Reorder freeing this hashmap before destroying device objects to fix crash on exit.
This commit is contained in:
		
							parent
							
								
									ef6ceb83a2
								
							
						
					
					
						commit
						3fc2ac10c6
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -163,11 +163,11 @@ void pa__done(pa_module *m) {
 | 
				
			||||||
    if (u->device_connection_changed_slot)
 | 
					    if (u->device_connection_changed_slot)
 | 
				
			||||||
        pa_hook_slot_free(u->device_connection_changed_slot);
 | 
					        pa_hook_slot_free(u->device_connection_changed_slot);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (u->discovery)
 | 
					 | 
				
			||||||
        pa_bluetooth_discovery_unref(u->discovery);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (u->loaded_device_paths)
 | 
					    if (u->loaded_device_paths)
 | 
				
			||||||
        pa_hashmap_free(u->loaded_device_paths);
 | 
					        pa_hashmap_free(u->loaded_device_paths);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (u->discovery)
 | 
				
			||||||
 | 
					        pa_bluetooth_discovery_unref(u->discovery);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_xfree(u);
 | 
					    pa_xfree(u);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue