Fix possible crash when removing disconnect watches
Luiz Augusto von Dentz
maintainerPATCH 1/1 Fix possible crash when removing disconnect watches
From: Luiz Augusto von Dentz <[email protected]>
The callback may have remove itself before returning.
--- src/device.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
src/device.c +4 -0
@@ -798,6 +798,10 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg) data->watch (device, device->temporary, data->user_data); +/* Check if the watch has been removed by callback function */ +if (!g_slist_find (device->watches, data)) +continue ; + device->watches =g_slist_remove (device->watches, data);g_free (data); }
Signature · 1 line
1.7.1
Hi Luiz,
Quoted 6 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
The callback may have remove itself before returning.
--- src/device.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Pushed upstream. Thanks.
Johan