Skip to content
Snippets Groups Projects
Commit f1eee2a2 authored by Chris Manton's avatar Chris Manton
Browse files

Plug vendor privacy memory leak

Bug: 208679962
Tag: #refactor
Test: gd/cert/run
Change-Id: Ieec7a233e71b58387e3e65a36dd3ceea0707fcee
parent 1a79ff1b
No related branches found
No related tags found
No related merge requests found
......@@ -172,8 +172,8 @@ typedef uint16_t tBTM_BLE_STATE_MASK;
(BTM_BLE_STATE_CENTRAL_BIT | BTM_BLE_STATE_PERIPHERAL_BIT)
typedef struct {
RawAddress* resolve_q_random_pseudo;
uint8_t* resolve_q_action;
RawAddress* resolve_q_random_pseudo{nullptr};
uint8_t* resolve_q_action{nullptr};
uint8_t q_next;
uint8_t q_pending;
} tBTM_BLE_RESOLVE_Q;
......@@ -269,7 +269,8 @@ typedef struct {
uint8_t resolving_list_avail_size; /* resolving list available size */
tBTM_BLE_RESOLVE_Q resolving_list_pend_q; /* Resolving list queue */
tBTM_BLE_RL_STATE suspended_rl_state; /* Suspended resolving list state */
uint8_t* irk_list_mask; /* IRK list availability mask, up to max entry bits */
/* IRK list availability mask, up to max entry bits */
uint8_t* irk_list_mask{nullptr};
tBTM_BLE_RL_STATE rl_state; /* Resolving list state */
/* current BLE link state */
......
......@@ -800,7 +800,7 @@ void btm_ble_resolving_list_init(uint8_t max_irk_list_sz) {
uint8_t irk_mask_size =
(max_irk_list_sz % 8) ? (max_irk_list_sz / 8 + 1) : (max_irk_list_sz / 8);
if (max_irk_list_sz > 0) {
if (max_irk_list_sz > 0 && p_q->resolve_q_random_pseudo == nullptr) {
// NOTE: This memory is never freed
p_q->resolve_q_random_pseudo =
(RawAddress*)osi_malloc(sizeof(RawAddress) * max_irk_list_sz);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment