bt component: Fix memory leak while using gatt server

- fix memory leak while creating attribute table
- fix memory leak while deleting service
This commit is contained in:
island
2017-04-12 11:09:55 +08:00
parent 3cad00fdcc
commit f688309b3a
8 changed files with 78 additions and 4 deletions

View File

@@ -214,6 +214,7 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid,
if (p_list) {
gatt_remove_an_item_from_list(p_list_info, p_list);
gatt_free_attr_value_buffer(p_list);
gatt_free_hdl_buffer(p_list);
}
return (0);
@@ -227,6 +228,7 @@ UINT16 GATTS_CreateService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid,
GATT_TRACE_ERROR ("GATTS_ReserveHandles: service DB initialization failed\n");
if (p_list) {
gatt_remove_an_item_from_list(p_list_info, p_list);
gatt_free_attr_value_buffer(p_list);
gatt_free_hdl_buffer(p_list);
}
@@ -413,6 +415,7 @@ BOOLEAN GATTS_DeleteService (tGATT_IF gatt_if, tBT_UUID *p_svc_uuid, UINT16 svc_
}
gatt_remove_an_item_from_list(p_list_info, p_list);
gatt_free_attr_value_buffer(p_list);
gatt_free_hdl_buffer(p_list);
return (TRUE);