diff options
Diffstat (limited to 'chrome/browser/extensions/api/bluetooth/bluetooth_api.cc')
-rw-r--r-- | chrome/browser/extensions/api/bluetooth/bluetooth_api.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc index c983544..9517bc6 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc @@ -393,7 +393,9 @@ void BluetoothReadFunction::Work() { if (total_bytes_read > 0) { success_ = true; - SetResult(base::BinaryValue::Create(all_bytes, total_bytes_read)); + SetResult(base::BinaryValue::CreateWithCopiedBuffer(all_bytes, + total_bytes_read)); + free(all_bytes); } else { success_ = (errsv == EAGAIN || errsv == EWOULDBLOCK); free(all_bytes); |