Skip to content

Commit 4acb393

Browse files
committed
Cordio BLE: Fix potential memory leak in GattServer.
1 parent ee720f3 commit 4acb393

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ ble_error_t GattServer::addService(GattService &service)
8484
att_service->attGroup.pAttr =
8585
(attsAttr_t*) alloc_block(attributes_count * sizeof(attsAttr_t));
8686
if (att_service->attGroup.pAttr == NULL) {
87+
delete att_service;
8788
return BLE_ERROR_BUFFER_OVERFLOW;
8889
}
8990

0 commit comments

Comments
 (0)