Fix the prevent issues 18/196618/1 accepted/tizen_4.0_unified accepted/tizen/4.0/unified/20190103.235207 submit/tizen_4.0/20190103.044435
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 3 Jan 2019 04:14:41 +0000 (13:14 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 3 Jan 2019 04:14:41 +0000 (13:14 +0900)
Change-Id: Ie3516c9b7a84f965442f7c851c93bb5271ba0f40
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/bluetooth-adapter.c

index 0fd3b5b7d0b7567fb2da2807ffb61b4bd48befc5..22513a1581043a06e96e4c027dd29c1d33ed16d9 100644 (file)
@@ -626,6 +626,7 @@ int bt_adapter_foreach_bonded_device(bt_adapter_bonded_device_cb foreach_cb,
        if (ret != BT_ERROR_NONE) {
                BT_ERR("%s(0x%08x) : Failed to get bonded device list", /* LCOV_EXCL_LINE */
                _bt_convert_error_to_string(ret), ret); /* LCOV_EXCL_LINE */
+               g_ptr_array_free(dev_list, TRUE);
                return ret;
        }
 
@@ -770,6 +771,7 @@ int bt_adapter_foreach_profile_connected_devices(const char *profile_uuid,
        if (ret != BT_ERROR_NONE) {
                BT_ERR("%s(0x%08x) : Failed to get profile connected device list",
                                _bt_convert_error_to_string(ret), ret);
+               g_ptr_array_free(addr_list, TRUE);
                return ret;
        }
 
@@ -779,7 +781,7 @@ int bt_adapter_foreach_profile_connected_devices(const char *profile_uuid,
                        ret = _bt_convert_address_to_string(&remote_address, remote_addr);
                        if (ret != BT_ERROR_NONE) {
                                BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(ret), ret);
-                               return ret;
+                               break;
                        }
 
                        if (!callback(remote_address, user_data)) {