• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

system/bt


Commit MetaInfo

Revision1e0bb31f6a809b49014483dc118b9d9ad31ade68 (tree)
Zeit2017-08-09 03:45:04
AutorPavlin Radoslavov <pavlin@goog...>
Commiterandroid-build-team Robot

Log Message

Free p_pending_data from tBNEP_CONN to avoid potential memory leaks

Bug: 63146105
Test: External script
Change-Id: I1281779ccf38d1d2dfb1a6dc0e45c0e533cabbca
Merged-In: I1281779ccf38d1d2dfb1a6dc0e45c0e533cabbca
(cherry picked from commit 4982eb5df30cbcbee5c8b8807be95fdc6dfa63c5)
(cherry picked from commit a654681c5558904a8abfa1bbab8eafb651c13231)

Ändern Zusammenfassung

Diff

--- a/stack/bnep/bnep_main.cc
+++ b/stack/bnep/bnep_main.cc
@@ -525,6 +525,7 @@ static void bnep_data_ind(uint16_t l2cap_cid, BT_HDR* p_buf) {
525525 if (ctrl_type == BNEP_SETUP_CONNECTION_REQUEST_MSG &&
526526 p_bcb->con_state != BNEP_STATE_CONNECTED && extension_present && p &&
527527 rem_len) {
528+ osi_free(p_bcb->p_pending_data);
528529 p_bcb->p_pending_data = (BT_HDR*)osi_malloc(rem_len + sizeof(BT_HDR));
529530 memcpy((uint8_t*)(p_bcb->p_pending_data + 1), p, rem_len);
530531 p_bcb->p_pending_data->len = rem_len;
--- a/stack/bnep/bnep_utils.cc
+++ b/stack/bnep/bnep_utils.cc
@@ -144,7 +144,7 @@ void bnepu_release_bcb(tBNEP_CONN* p_bcb) {
144144
145145 /* Drop any response pointer we may be holding */
146146 p_bcb->con_state = BNEP_STATE_IDLE;
147- p_bcb->p_pending_data = NULL;
147+ osi_free_and_reset((void**)&p_bcb->p_pending_data);
148148
149149 /* Free transmit queue */
150150 while (!fixed_queue_is_empty(p_bcb->xmit_q)) {