From 4acb3937e44693fbe16f6d398468afa496d9f7ee Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Tue, 15 May 2018 14:32:29 +0100 Subject: [PATCH] Cordio BLE: Fix potential memory leak in GattServer. --- .../targets/TARGET_CORDIO/source/CordioGattServer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp index 0d6b73376d..41568ab5f3 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp @@ -84,6 +84,7 @@ ble_error_t GattServer::addService(GattService &service) att_service->attGroup.pAttr = (attsAttr_t*) alloc_block(attributes_count * sizeof(attsAttr_t)); if (att_service->attGroup.pAttr == NULL) { + delete att_service; return BLE_ERROR_BUFFER_OVERFLOW; }