From 199005a4e7ff6d65383c49b9c405fe426d64d090 Mon Sep 17 00:00:00 2001 From: Atul Rai Date: Tue, 10 Jul 2018 17:04:55 +0530 Subject: [PATCH] [BT-Service] Fix Coverity issues This patch fixes following Coverity issues: Id: 859618, 859586, 859605, 859624 Change-Id: Ic0213db613df41e663f351cd5d0c667404e6f23d Signed-off-by: Atul Rai --- bt-service-adaptation/services/gatt/bt-service-gatt.c | 2 ++ bt-service-adaptation/services/obex/bt-service-map-client.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bt-service-adaptation/services/gatt/bt-service-gatt.c b/bt-service-adaptation/services/gatt/bt-service-gatt.c index d56b9b1f..fda8ba5b 100644 --- a/bt-service-adaptation/services/gatt/bt-service-gatt.c +++ b/bt-service-adaptation/services/gatt/bt-service-gatt.c @@ -2986,6 +2986,7 @@ static void __bt_handle_client_disconnected(event_gattc_conn_t *event_data) __bt_gatt_handle_pending_request_info(result, BT_CONNECT_LE, address, BT_ADDRESS_STRING_SIZE); BT_ERR("Failed to connect Local GATT Remote addr[%s]", address); + g_free(address); return; } } else { @@ -3767,6 +3768,7 @@ static void __bt_hanlde_le_device_disconnection(event_dev_conn_status_t *event_d __bt_gatt_handle_pending_request_info(result, BT_CONNECT_LE, address, BT_ADDRESS_STRING_SIZE); + g_free(address); } static void __bt_handle_client_notification_registered( diff --git a/bt-service-adaptation/services/obex/bt-service-map-client.c b/bt-service-adaptation/services/obex/bt-service-map-client.c index e78bcf54..08f02953 100644 --- a/bt-service-adaptation/services/obex/bt-service-map-client.c +++ b/bt-service-adaptation/services/obex/bt-service-map-client.c @@ -296,7 +296,8 @@ int _bt_map_client_list_folders( } } - g_object_unref(message_access_proxy); + if (message_access_proxy) + g_object_unref(message_access_proxy); BT_DBG("-"); return result; @@ -467,7 +468,8 @@ int _bt_map_client_list_messages( } } - g_object_unref(message_access_proxy); + if (message_access_proxy) + g_object_unref(message_access_proxy); BT_DBG("-"); return result; -- 2.34.1