Fix coverty issue in gatt-client 54/224854/1
authorSudipto <sudipto.bal@samsung.com>
Thu, 13 Feb 2020 12:37:39 +0000 (18:07 +0530)
committerSudipto <sudipto.bal@samsung.com>
Thu, 13 Feb 2020 12:37:39 +0000 (18:07 +0530)
Change-Id: I075579e5d8511cc1b654723be0484e7f6e2331ca
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
bt-oal/bluez_hal/src/bt-hal-gatt-client.c

index bf10167..91e07f0 100644 (file)
@@ -2693,12 +2693,14 @@ static bt_status_t __hal_configure_mtu(int conn_id, int mtu)
        conn = _bt_hal_get_system_gconn();
        if (conn == NULL) {
                ERR("conn NULL");
+               g_free(conn_mtu);
                return BT_STATUS_FAIL;
        }
 
        gattc_client = __bt_find_gatt_client_info_from_conn_id(conn_id);
        if (gattc_client == NULL) {
                INFO("GATT client conn info not found");
+               g_free(conn_mtu);
                return BT_STATUS_FAIL;
        }
 
@@ -2708,6 +2710,7 @@ static bt_status_t __hal_configure_mtu(int conn_id, int mtu)
        device_path = _bt_hal_get_device_object_path(device_address);
        if (device_path == NULL) {
                ERR("device_path NULL : [%s]", device_address);
+               g_free(conn_mtu);
                return BT_STATUS_FAIL;
        }
 
@@ -2718,6 +2721,7 @@ static bt_status_t __hal_configure_mtu(int conn_id, int mtu)
        g_free(device_path);
        if (NULL == device_proxy) {
                ERR("device_proxy returned NULL");
+               g_free(conn_mtu);
                return BT_STATUS_FAIL;
        }