From 15047fe6670604d08df0dc9395993848078bd3ac Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 15 Nov 2022 00:02:27 -0800 Subject: [PATCH] Fix memory leak in bluetooth module --- modules/bluetooth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/bluetooth.c b/modules/bluetooth.c index 52ae50d..372332f 100644 --- a/modules/bluetooth.c +++ b/modules/bluetooth.c @@ -34,6 +34,12 @@ static void load_initial_device_states(GDBusConnection *dbus, dbus, "org.bluez", path, "org.freedesktop.DBus.Properties", "Get", g_variant_new_parsed("('org.bluez.Adapter1', 'Powered')"), (GVariantType *)"(v)", G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err); + if (err) { + qtb_log("checking bluetooth adapter power state failed\n-> %s", err->message); + g_error_free(err); + err = NULL; + qtb_die(); + } if (response) { GVariant *wrapper = g_variant_get_child_value(response, 0); GVariant *value = g_variant_get_child_value(wrapper, 0);