Bug 1068872 - Fix nullptr dereferencing. r=echou
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 18 Sep 2014 07:00:00 -0400
changeset 229666 91fb84885bcda62b7a38b984792c256bb9bc6cc8
parent 229665 e99d8abbc53065b5a931f11330f6ab27bca9f969
child 229667 7fef64119cf40061d8cbfcfb0ed3ec458ff53c27
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou
bugs1068872
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1068872 - Fix nullptr dereferencing. r=echou
dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
--- a/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluedroid/hfp/BluetoothHfpManager.cpp
@@ -1215,17 +1215,19 @@ private:
 void
 BluetoothHfpManager::Disconnect(BluetoothProfileController* aController)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mController);
 
   if (!sBluetoothHfpInterface) {
     BT_LOGR("sBluetoothHfpInterface is null");
-    aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
+    if (aController) {
+      aController->NotifyCompletion(NS_LITERAL_STRING(ERR_NO_AVAILABLE_RESOURCE));
+    }
     return;
   }
 
   mController = aController;
 
   sBluetoothHfpInterface->Disconnect(mDeviceAddress,
                                      new DisconnectResultHandler(this));
 }