From 4b3788d0794b827e7062e0e6d0a8da9fecec7ae3 Mon Sep 17 00:00:00 2001 From: Anuj Bhumiya Date: Tue, 20 Jul 2021 17:48:23 +0530 Subject: [PATCH] Fix Svace defect This patch includes the fix of svace defect on latest CAPI code. Change-Id: Ibc49749a28313c2efac315f9f5d551a4a522ef19 Signed-off-by: Anuj Bhumiya --- src/bluetooth-gatt.c | 2 ++ src/bluetooth-hdp.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/bluetooth-gatt.c b/src/bluetooth-gatt.c index da55e30..bfba256 100644 --- a/src/bluetooth-gatt.c +++ b/src/bluetooth-gatt.c @@ -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; } diff --git a/src/bluetooth-hdp.c b/src/bluetooth-hdp.c index cefefa3..dc6f18c 100644 --- a/src/bluetooth-hdp.c +++ b/src/bluetooth-hdp.c @@ -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; -- 2.34.1