Fix Svace defect 24/261524/1 accepted/tizen/unified/20210726.135433 submit/tizen/20210726.004751
authorAnuj Bhumiya <anuj.bhumiya@samsung.com>
Tue, 20 Jul 2021 12:18:23 +0000 (17:48 +0530)
committerAnuj Bhumiya <anuj.bhumiya@samsung.com>
Tue, 20 Jul 2021 12:18:23 +0000 (17:48 +0530)
This patch includes the fix of svace defect on latest CAPI code.

Change-Id: Ibc49749a28313c2efac315f9f5d551a4a522ef19
Signed-off-by: Anuj Bhumiya <anuj.bhumiya@samsung.com>
src/bluetooth-gatt.c
src/bluetooth-hdp.c

index da55e30..bfba256 100644 (file)
@@ -257,6 +257,7 @@ bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client,
        svc = __bt_gatt_service_create(property.uuid,
                        BT_GATT_SERVICE_TYPE_PRIMARY);
        if (svc == NULL) {
+               bluetooth_gatt_free_service_property(&property);
                BT_ERR("svc is NULL");
                return NULL;
        }
@@ -303,6 +304,7 @@ bt_gatt_h _bt_gatt_client_add_service(bt_gatt_client_h client, const char *path)
        svc = __bt_gatt_service_create(property.uuid,
                                BT_GATT_SERVICE_TYPE_PRIMARY);
        if (svc == NULL) {
+               bluetooth_gatt_free_service_property(&property);
                BT_ERR("svc is NULL");
                return NULL;
        }
index cefefa3..dc6f18c 100644 (file)
@@ -46,6 +46,7 @@ int bt_hdp_register_sink_app(unsigned short data_type, char **app_id)
        }
 
        *app_id = strdup(app_handle);
+       g_free(app_handle);
        if (*app_id == NULL)
                return BT_ERROR_OUT_OF_MEMORY;