Bug 1221898 - Fix PBAP memory leakage, r=brsun
authorBen Tian <btian@mozilla.com>
Fri, 06 Nov 2015 16:23:30 +0800
changeset 293154 6cf483eb34a6309ecaa56549be0a1529f4c043bb
parent 293153 542763d3a90da3b0f09fd36b71d41d412a90693c
child 293155 eb47539223033a97e9ee4f89684fff65f8881b4a
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbrsun
bugs1221898
milestone45.0a1
Bug 1221898 - Fix PBAP memory leakage, r=brsun
dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
--- a/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothPbapManager.cpp
@@ -920,17 +920,17 @@ BluetoothPbapManager::ReplyToGet(uint16_
       }
 
       // |numRead| must be non-zero as |bytesAvailable| is non-zero
       MOZ_ASSERT(numRead);
 
       // ----  Part 2b: [headerId:1][length:2][Body:var] ---- //
       index += AppendHeaderBody(&res[index],
                                 remainingPacketSize,
-                                (uint8_t*) buf.forget(),
+                                reinterpret_cast<uint8_t*>(buf.get()),
                                 numRead);
 
       opcode = ObexResponseCode::Continue;
     }
   }
 
   SendObexData(res, opcode, index);
   delete [] res;