Cordio BLE: Fix potential memory leak in GattServer.

pull/6932/head
Vincent Coubard 2018-05-15 14:32:29 +01:00
parent ee720f30bb
commit 4acb3937e4
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}