Fix the coverity issue (resource leak) 07/258707/1
authorAnuj Jain <anuj01.jain@samsung.com>
Mon, 24 May 2021 08:46:43 +0000 (14:16 +0530)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 24 May 2021 12:47:22 +0000 (18:17 +0530)
Variable str must be free after its usage.
This change fixes the same.

Change-Id: I880aa48cbf31d13a27a47b7fc08807a56af18fd3
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
src/adapter.c

index 2b0bf3a..b8ebc90 100644 (file)
@@ -11270,6 +11270,7 @@ static void load_config(struct btd_adapter *adapter)
                        adapter->a2dp_role = BLUETOOTH_A2DP_SINK_ROLE;
                else if (g_strcmp0(str, "source") == 0)
                        adapter->a2dp_role = BLUETOOTH_A2DP_SOURCE_ROLE;
+               g_free(str);
        }
 #endif