mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-06 05:14:45 +00:00
fix(nimble): Fixed memory leak when dynamic services are disabled
This commit is contained in:
@@ -1721,6 +1721,9 @@ ble_gatts_free_svc_defs(void)
|
||||
static void
|
||||
ble_gatts_free_mem(void)
|
||||
{
|
||||
#if !MYNEWT_VAL(BLE_DYNAMIC_SERVICE)
|
||||
int rc;
|
||||
#endif
|
||||
#if MYNEWT_VAL(BLE_DYNAMIC_SERVICE)
|
||||
struct ble_gatts_svc_entry *entry;
|
||||
struct ble_gatts_clt_cfg *clt_cfg;
|
||||
@@ -1732,6 +1735,12 @@ ble_gatts_free_mem(void)
|
||||
ble_gatts_clt_cfg_free(clt_cfg);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (ble_gatts_clt_cfgs != NULL) {
|
||||
rc = os_memblock_put(&ble_gatts_clt_cfg_pool, ble_gatts_clt_cfgs);
|
||||
BLE_HS_DBG_ASSERT_EVAL(rc == 0);
|
||||
ble_gatts_clt_cfgs = NULL;
|
||||
}
|
||||
#endif
|
||||
#if MYNEWT_VAL(BLE_STATIC_TO_DYNAMIC)
|
||||
if (ble_hs_max_client_configs > 0) {
|
||||
|
||||
Reference in New Issue
Block a user