fix use after free crash

This commit is contained in:
Matthias Ringwald 2015-10-15 21:26:27 +02:00
parent 97b901d7da
commit a4c6d0a0bc

View File

@ -2204,9 +2204,12 @@ void hci_run(void){
}
if (entry->state & LE_WHITELIST_REMOVE_FROM_CONTROLLER){
bd_addr_t address;
bd_addr_type_t address_type = entry->address_type;
memcpy(address, entry->address, 6);
linked_list_remove(&hci_stack->le_whitelist, (linked_item_t *) entry);
btstack_memory_whitelist_entry_free(entry);
hci_send_cmd(&hci_le_remove_device_from_white_list, entry->address_type, entry->address);
hci_send_cmd(&hci_le_remove_device_from_white_list, address_type, address);
return;
}
}