Nimble: Fixes for memory leak / optimization

This commit is contained in:
Rahul Tank
2023-04-18 15:01:09 +05:30
parent 1c07880c34
commit 13f62f9d4b
3 changed files with 3 additions and 2 deletions

View File

@@ -480,7 +480,7 @@ config BT_NIMBLE_HS_STOP_TIMEOUT_MS
config BT_NIMBLE_HOST_BASED_PRIVACY config BT_NIMBLE_HOST_BASED_PRIVACY
bool "Enable host based privacy for random address." bool "Enable host based privacy for random address."
default n default n
depends on BT_NIMBLE_ENABLED && !IDF_TARGET_ESP32 depends on BT_NIMBLE_ENABLED && IDF_TARGET_ESP32
help help
Use this option to do host based Random Private Address resolution. Use this option to do host based Random Private Address resolution.
If this option is disabled then controller based privacy is used. If this option is disabled then controller based privacy is used.

View File

@@ -366,6 +366,7 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
assert(evbuf != NULL); assert(evbuf != NULL);
} }
memset(evbuf, 0, sizeof *evbuf);
memcpy(evbuf, &data[1], totlen); memcpy(evbuf, &data[1], totlen);
rc = ble_hci_trans_ll_evt_tx(evbuf); rc = ble_hci_trans_ll_evt_tx(evbuf);