Fix for destroying gatt client in case of error. 61/214861/1
authorKush <kush.agrawal@samsung.com>
Thu, 19 Sep 2019 08:39:01 +0000 (14:09 +0530)
committerhimanshu <h.himanshu@samsung.com>
Fri, 27 Sep 2019 06:58:11 +0000 (12:28 +0530)
Client Handle was not destroyed.
Because of that from second time onwards client handle was not getting created.
MTU size was set to default and bt buffer overflow error was coming.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/578/commits/e51cc0061628ab0fb7710ed3a5c3df08b61e2d5a
(cherry-picked from e51cc0061628ab0fb7710ed3a5c3df08b61e2d5a)

Change-Id: I65e5092c8b9c230b4394dd6239706b5f2d28fd36
Signed-off-by: Kush <kush.agrawal@samsung.com>
Signed-off-by: himanshu <h.himanshu@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver_vd.c

index f06d8c6..68ad1f5 100644 (file)
@@ -1082,6 +1082,7 @@ uint16_t CALEServerGetMtuSize(const char* address)
     {
         OIC_LOG_V(ERROR, TAG,
                   "bt_gatt_client_get_att_mtu failed with return [%s]", CALEGetErrorMsg(ret));
+        bt_gatt_client_destroy(client);
         oc_mutex_unlock(g_LEClientListMutex);
         return CA_DEFAULT_BLE_MTU_SIZE;
     }