From: Anuj Bhumiya Date: Tue, 20 Jul 2021 12:18:23 +0000 (+0530) Subject: Fix Svace defect X-Git-Tag: submit/tizen/20210726.004751^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b3788d0794b827e7062e0e6d0a8da9fecec7ae3;p=platform%2Fcore%2Fapi%2Fbluetooth.git Fix Svace defect This patch includes the fix of svace defect on latest CAPI code. Change-Id: Ibc49749a28313c2efac315f9f5d551a4a522ef19 Signed-off-by: Anuj Bhumiya --- 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;