adapter: Fix warning when exit
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 17 Aug 2021 00:51:39 +0000 (17:51 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:36 +0000 (19:08 +0530)
g_hash_table_destroy prints a warning when it is NULL so this checks if
adapter->allowed_uuid_set has actually been set.

Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/adapter.c

index 76708f5..af32848 100644 (file)
@@ -10496,7 +10496,10 @@ static void adapter_free(gpointer user_data)
        g_free(adapter->stored_alias);
        g_free(adapter->current_alias);
        free(adapter->modalias);
-       g_hash_table_destroy(adapter->allowed_uuid_set);
+
+       if (adapter->allowed_uuid_set)
+               g_hash_table_destroy(adapter->allowed_uuid_set);
+
        g_free(adapter);
 }