Skip to content

Commit ca9b705

Browse files
committed
Remove nullptr check when deleting _implicit_cccd
1 parent 5c82533 commit ca9b705

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

connectivity/FEATURE_BLE/include/ble/gatt/GattCharacteristic.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,9 +1430,8 @@ class GattCharacteristic {
14301430
GattCharacteristic& operator=(const GattCharacteristic &) = delete;
14311431

14321432
~GattCharacteristic() {
1433-
if(_implicit_cccd != nullptr) {
14341433
delete _implicit_cccd;
1435-
}
1434+
_implicit_cccd = nullptr;
14361435
}
14371436

14381437
public:
@@ -1821,7 +1820,7 @@ class GattCharacteristic {
18211820
* the constructor includes a CCCD this field is left as nullptr to
18221821
* indicate the CCCD was explicitly created.
18231822
*/
1824-
GattAttribute* _implicit_cccd;
1823+
GattAttribute* _implicit_cccd = nullptr;
18251824

18261825
/**
18271826
* The registered callback handler for read authorization reply.

0 commit comments

Comments
 (0)