Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d60daa82 authored by Hemant Gupta's avatar Hemant Gupta Committed by Hansong Zhang
Browse files

BLE: Continue after list_remove in btm_consolidate_dev

Since p_dev_rec gets freed in list_remove, it should not be
accessed again in the same iteration.

Test: Code Review

Bug: 69237299
Change-Id: If7b12cb02fed8f03079c77cf9ea7e773c80cb340
parent 1ce1d04b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -410,6 +410,8 @@ void btm_consolidate_dev(tBTM_SEC_DEV_REC* p_target_rec) {

      /* remove the combined record */
      list_remove(btm_cb.sec_dev_rec, p_dev_rec);
      // p_dev_rec gets freed in list_remove, we should not  access it further
      continue;
    }

    /* an RPA device entry is a duplicate of the target record */