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

Commit 3e5ecb00 authored by JiLin Wan's avatar JiLin Wan Committed by jilin wan
Browse files

Fix a2dp_list no free

The a2dp_list allocated at function bta_av_alloc_scb,
but not free at function bta_av_free_scb, which would
cause memory lost.

Bug: 300342691
Test: atest net_host_test_bta pass

Change-Id: I6eb7519e21f08a6b1a68274adf5848bc940bd9cb
parent f0c7602d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -344,6 +344,8 @@ void bta_av_free_scb(tBTA_AV_SCB* p_scb) {
  CHECK(p_scb == bta_av_cb.p_scb[scb_index]);
  bta_av_cb.p_scb[scb_index] = nullptr;
  alarm_free(p_scb->avrc_ct_timer);
  list_free(p_scb->a2dp_list);
  p_scb->a2dp_list = NULL;
  // TODO: After tBTA_AV_SCB is changed to a proper class, the entry
  // here should be de-allocated by C++ 'delete' statement.
  osi_free(p_scb);