66 lines
2.3 KiB
Diff
66 lines
2.3 KiB
Diff
|
|
From c1a32c45afa855547cd9b7aabc87fc16f7ec28f3 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= <houhongxun@kylinos.cn>
|
||
|
|
Date: Sun, 28 Apr 2024 10:06:12 +0800
|
||
|
|
Subject: [PATCH] fix possible null pointer derefrence problem
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
Signed-off-by: 侯红勋 <houhongxun@kylinos.cn>
|
||
|
|
---
|
||
|
|
ukcc-bluetooth/bluetoothmain.cpp | 10 +++++-----
|
||
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/ukcc-bluetooth/bluetoothmain.cpp b/ukcc-bluetooth/bluetoothmain.cpp
|
||
|
|
index 7370c3f..22fb70f 100644
|
||
|
|
--- a/ukcc-bluetooth/bluetoothmain.cpp
|
||
|
|
+++ b/ukcc-bluetooth/bluetoothmain.cpp
|
||
|
|
@@ -398,7 +398,7 @@ bluetoothadapter * BlueToothMain::createOneBluetoothAdapter(QString adapter_addr
|
||
|
|
if (adapter_dev_name.isEmpty())
|
||
|
|
{
|
||
|
|
qDebug() << Q_FUNC_INFO << "name is null!" << __LINE__;
|
||
|
|
- adapter_dev->deleteLater();
|
||
|
|
+ //adapter_dev->deleteLater();
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
@@ -409,7 +409,7 @@ bluetoothadapter * BlueToothMain::createOneBluetoothAdapter(QString adapter_addr
|
||
|
|
if (adapter_address == tmpDev->getDevAddress())
|
||
|
|
{
|
||
|
|
qDebug() << Q_FUNC_INFO << "device existing!" << __LINE__;
|
||
|
|
- adapter_dev->deleteLater();
|
||
|
|
+ //adapter_dev->deleteLater();
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
@@ -687,7 +687,7 @@ bluetoothdevice * BlueToothMain::createOneBluetoothDevice(QString devAddress)
|
||
|
|
if (dev_name.isEmpty())
|
||
|
|
{
|
||
|
|
qDebug() << Q_FUNC_INFO << "name is null!" << __LINE__;
|
||
|
|
- dev->deleteLater();
|
||
|
|
+ //dev->deleteLater();
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
|
||
|
|
@@ -699,7 +699,7 @@ bluetoothdevice * BlueToothMain::createOneBluetoothDevice(QString devAddress)
|
||
|
|
if(isInvalidDevice(dev_name,dev_type))
|
||
|
|
{
|
||
|
|
qDebug() << Q_FUNC_INFO << "isInvalidDevice!" << __LINE__;
|
||
|
|
- dev->deleteLater();
|
||
|
|
+ //dev->deleteLater();
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
|
||
|
|
@@ -709,7 +709,7 @@ bluetoothdevice * BlueToothMain::createOneBluetoothDevice(QString devAddress)
|
||
|
|
if (devAddress == tmpDev->getDevAddress())
|
||
|
|
{
|
||
|
|
qDebug() << Q_FUNC_INFO << "device existing!" << __LINE__;
|
||
|
|
- dev->deleteLater();
|
||
|
|
+ //dev->deleteLater();
|
||
|
|
return nullptr;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.43.0
|
||
|
|
|