[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] module-bluez5-discover: avoid use after free on de-init

Arun Raghavan gitlab at gitlab.freedesktop.org
Fri Oct 23 09:04:17 UTC 2020



Arun Raghavan pushed to branch master at PulseAudio / pulseaudio


Commits:
3fc2ac10 by Igor V. Kovalenko at 2020-10-23T04:57:15-04: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.

- - - - -


1 changed file:

- src/modules/bluetooth/module-bluez5-discover.c


Changes:

=====================================
src/modules/bluetooth/module-bluez5-discover.c
=====================================
@@ -163,11 +163,11 @@ void pa__done(pa_module *m) {
     if (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)
         pa_hashmap_free(u->loaded_device_paths);
 
+    if (u->discovery)
+        pa_bluetooth_discovery_unref(u->discovery);
+
     pa_xfree(u);
 }



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3fc2ac10c68a57b1fbdc8c464c6a181d4ab31053

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3fc2ac10c68a57b1fbdc8c464c6a181d4ab31053
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20201023/d2b9cbe1/attachment.htm>


More information about the pulseaudio-commits mailing list