OSDN Git Service

Fix valgrind error
authorJakub Pawlowski <jpawlowski@google.com>
Tue, 12 Apr 2016 13:44:52 +0000 (06:44 -0700)
committerJakub Pawlowski <jpawlowski@google.com>
Tue, 12 Apr 2016 13:45:38 +0000 (06:45 -0700)
This patch fixes following valgrind error message:
==5000== Thread 6 bt_jni_workqueue:
==5000== Conditional jump or move depends on uninitialised value(s)
==5000==    at 0x4353C7:
bluetooth::LowEnergyClient::ScanResultCallback(bluetooth::hal::BluetoothGattInterface*,
bt_bdaddr_t const&, int, unsigned char*) (low_energy_client.cpp:573)
==5000==    by 0x443BBB: bluetooth::hal::(anonymous
namespace)::ScanResultCallback(bt_bdaddr_t*, int, unsigned char*)
(bluetooth_gatt_interface.cpp:91)

Bug: 28113318
Change-Id: Ide82c6a7f68f6bbe427f12ca353d62f1d999d0ae

service/low_energy_client.cpp

index cc568de..aae554c 100644 (file)
@@ -313,7 +313,8 @@ LowEnergyClient::LowEnergyClient(
       adv_started_(false),
       adv_start_callback_(nullptr),
       adv_stop_callback_(nullptr),
-      scan_started_(false) {
+      scan_started_(false),
+      delegate_(nullptr) {
 }
 
 LowEnergyClient::~LowEnergyClient() {