Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 11745016: BinaryValue support for NULL buffer. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: BinaryValue support for NULL buffer. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/extensions/api/socket/socket_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
index c983544b2bf73944862d081bf0809efc69eb54c8..9517bc6528e169b30e71c3967273ab4234509e44 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);
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/extensions/api/socket/socket_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698