Fix the memory leak 36/242736/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 31 Aug 2020 23:14:00 +0000 (08:14 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 31 Aug 2020 23:14:00 +0000 (08:14 +0900)
Change-Id: I979015708fe61ab9146cdd56a8670b8adba6019b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bluetooth-adapter.c

index 668041e..e445a89 100644 (file)
@@ -2327,11 +2327,14 @@ int bt_adapter_le_add_advertising_service_data(bt_advertiser_h advertiser,
        g_free(uuid_ptr);
 
        ret = __bt_find_uuid_in_service_data(advertiser, pkt_type, converted_uuid, &exist);
-       if (ret != BT_ERROR_NONE)
+       if (ret != BT_ERROR_NONE) {
+               g_free(converted_uuid);
                return ret;
+       }
 
        if (exist) {
                BT_INFO("Aleady existed");
+               g_free(converted_uuid);
                return BT_ERROR_ALREADY_DONE;
        }