Merge branch 'bugfix/btdm_fix_memory_leak_for_SMP' into 'master'

component/bt: fix memory leak in SMP

See merge request !1690
This commit is contained in:
Jiang Jiang Jian 2017-12-27 11:43:18 +08:00
commit d31b654f3f
3 changed files with 6 additions and 8 deletions

View File

@ -250,12 +250,6 @@ static void btc_dm_ble_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
if (btc_storage_get_remote_addr_type(&bdaddr, &addr_type) != BT_STATUS_SUCCESS) { if (btc_storage_get_remote_addr_type(&bdaddr, &addr_type) != BT_STATUS_SUCCESS) {
btc_storage_set_remote_addr_type(&bdaddr, p_auth_cmpl->addr_type, true); btc_storage_set_remote_addr_type(&bdaddr, p_auth_cmpl->addr_type, true);
} }
/* check the irk has been save in the flash or not, if the irk has already save, means that the peer device has bonding
before. */
if(pairing_cb.ble.is_pid_key_rcvd) {
btc_storage_compare_address_key_value(&bdaddr, BTM_LE_KEY_PID,
(void *)&pairing_cb.ble.pid_key, sizeof(tBTM_LE_PID_KEYS));
}
btc_dm_save_ble_bonding_keys(); btc_dm_save_ble_bonding_keys();
} else { } else {
/*Map the HCI fail reason to bt status */ /*Map the HCI fail reason to bt status */

View File

@ -436,6 +436,9 @@ static void config_parse(nvs_handle fp, config_t *config)
esp_err_t err; esp_err_t err;
size_t length = CONFIG_FILE_MAX_SIZE; size_t length = CONFIG_FILE_MAX_SIZE;
err = nvs_get_blob(fp, CONFIG_KEY, buf, &length); err = nvs_get_blob(fp, CONFIG_KEY, buf, &length);
if (err == ESP_ERR_NVS_NOT_FOUND) {
goto error;
}
if (err != ESP_OK) { if (err != ESP_OK) {
err_code |= 0x02; err_code |= 0x02;
goto error; goto error;

View File

@ -2762,8 +2762,9 @@ void btm_sec_check_pending_reqs (void)
/* Now, re-submit anything in the mux queue */ /* Now, re-submit anything in the mux queue */
bq = btm_cb.sec_pending_q; bq = btm_cb.sec_pending_q;
if (!btm_cb.sec_pending_q) {
btm_cb.sec_pending_q = fixed_queue_new(SIZE_MAX); btm_cb.sec_pending_q = fixed_queue_new(SIZE_MAX);
}
while ((p_e = (tBTM_SEC_QUEUE_ENTRY *)fixed_queue_try_dequeue(bq)) != NULL) { while ((p_e = (tBTM_SEC_QUEUE_ENTRY *)fixed_queue_try_dequeue(bq)) != NULL) {
/* Check that the ACL is still up before starting security procedures */ /* Check that the ACL is still up before starting security procedures */