fix vendor hci memory leak

This commit is contained in:
zwj 2020-09-17 14:32:27 +08:00 committed by zhiweijian
parent b1c383211c
commit a2eec8a1e2
2 changed files with 9 additions and 7 deletions

View File

@ -2663,9 +2663,7 @@ void BTA_VendorCleanup (void)
} }
#endif #endif
if (cmn_ble_vsc_cb.adv_inst_max > 0) { btm_ble_multi_adv_cleanup();
btm_ble_multi_adv_cleanup();
}
} }
#endif #endif

View File

@ -840,10 +840,14 @@ void btm_ble_multi_adv_cleanup(void)
} }
#if BTM_DYNAMIC_MEMORY == TRUE #if BTM_DYNAMIC_MEMORY == TRUE
osi_free(btm_multi_adv_cb_ptr); if(btm_multi_adv_cb_ptr) {
osi_free(btm_multi_adv_idx_q_ptr); osi_free(btm_multi_adv_cb_ptr);
btm_multi_adv_cb_ptr = NULL; btm_multi_adv_cb_ptr = NULL;
btm_multi_adv_idx_q_ptr = NULL; }
if(btm_multi_adv_idx_q_ptr) {
osi_free(btm_multi_adv_idx_q_ptr);
btm_multi_adv_idx_q_ptr = NULL;
}
#endif #endif
} }