From 3b5b0078c5e9c4cb7ae81921422c8a74b74aaeeb Mon Sep 17 00:00:00 2001 From: Max van Kessel Date: Mon, 17 Apr 2023 15:15:53 +0200 Subject: [PATCH] dbus: prevent double free timeout event SUL callback triggers a dbus timeout handle, handle removes the linked list entry and free's the memory attached to the entry. Remove the code where the the entry was removed by the timer callback, which triggered a double free of the same linked list entry. --- lib/roles/dbus/dbus.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/roles/dbus/dbus.c b/lib/roles/dbus/dbus.c index 74278c92b..8578c8e5a 100644 --- a/lib/roles/dbus/dbus.c +++ b/lib/roles/dbus/dbus.c @@ -293,8 +293,6 @@ lws_dbus_sul_cb(lws_sorted_usec_list_t *sul) if (time(NULL) > r->fire) { lwsl_notice("%s: firing timer\n", __func__); dbus_timeout_handle(r->data); - lws_dll2_remove(rdt); - lws_free(rdt); } } lws_end_foreach_dll_safe(rdt, nx);