[pulseaudio-discuss,1/2] bluetooth: fix possible segfault in bluetooth backend-native.c module

Submitted by Andrew Hlynskyi on April 13, 2017, 5:22 a.m.

Details

Message ID 20170413052240.15869-2-ahlincq@gmail.com
State New
Headers show
Series "bluetooth: shutdown segmentation fault fixes" ( rev: 1 ) in PulseAudio

Not browsing as part of any series.

Commit Message

Andrew Hlynskyi April 13, 2017, 5:22 a.m.
The pa_bluetooth_transport_unlink function already
called by the pa_bluetooth_transport_free function.
---
 src/modules/bluetooth/backend-native.c | 1 -
 1 file changed, 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
index 6eb4e168..cbafaff6 100644
--- a/src/modules/bluetooth/backend-native.c
+++ b/src/modules/bluetooth/backend-native.c
@@ -415,7 +415,6 @@  static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
     return;
 
 fail:
-    pa_bluetooth_transport_unlink(t);
     pa_bluetooth_transport_free(t);
 }
 

Comments

On 13.04.2017 07:22, Andrew Hlynskyi wrote:
> The pa_bluetooth_transport_unlink function already
> called by the pa_bluetooth_transport_free function.
> ---
>   src/modules/bluetooth/backend-native.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
> index 6eb4e168..cbafaff6 100644
> --- a/src/modules/bluetooth/backend-native.c
> +++ b/src/modules/bluetooth/backend-native.c
> @@ -415,7 +415,6 @@ static void rfcomm_io_callback(pa_mainloop_api *io, pa_io_event *e, int fd, pa_i
>       return;
>   
>   fail:
> -    pa_bluetooth_transport_unlink(t);
>       pa_bluetooth_transport_free(t);
>   }
>   

mh, the patch is correct, but I do not see how it prevents a segfault. 
What exactly happens?