File tree 5 files changed +6
-6
lines changed
lib/dnssd/minimal_mdns/core/tests
5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ CHIP_ERROR AutoCommissioningWindowOpener::OpenBasicCommissioningWindow(DeviceCon
323
323
Seconds16 timeout)
324
324
{
325
325
// Not using Platform::New because we want to keep our constructor private.
326
- auto * opener = new AutoCommissioningWindowOpener (controller);
326
+ auto * opener = new (std::nothrow) AutoCommissioningWindowOpener (controller);
327
327
if (opener == nullptr )
328
328
{
329
329
return CHIP_ERROR_NO_MEMORY;
@@ -345,7 +345,7 @@ CHIP_ERROR AutoCommissioningWindowOpener::OpenCommissioningWindow(DeviceControll
345
345
SetupPayload & payload, bool readVIDPIDAttributes)
346
346
{
347
347
// Not using Platform::New because we want to keep our constructor private.
348
- auto * opener = new AutoCommissioningWindowOpener (controller);
348
+ auto * opener = new (std::nothrow) AutoCommissioningWindowOpener (controller);
349
349
if (opener == nullptr )
350
350
{
351
351
return CHIP_ERROR_NO_MEMORY;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ void pychip_CommissionableNodeController_PrintDiscoveredCommissioners(
50
50
ChipError::StorageType
51
51
pychip_CommissionableNodeController_NewController (chip::Controller::CommissionableNodeController ** outCommissionableNodeCtrl)
52
52
{
53
- *outCommissionableNodeCtrl = new chip::Controller::CommissionableNodeController ();
53
+ *outCommissionableNodeCtrl = new (std::nothrow) chip::Controller::CommissionableNodeController ();
54
54
VerifyOrReturnError (*outCommissionableNodeCtrl != nullptr , CHIP_ERROR_NO_MEMORY.AsInteger ());
55
55
return CHIP_NO_ERROR.AsInteger ();
56
56
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ chip::ChipError::StorageType pychip_InteractionModel_GetCommandSenderHandle(uint
55
55
{
56
56
chip::app::CommandSender * commandSenderObj = nullptr ;
57
57
VerifyOrReturnError (commandSender != nullptr , CHIP_ERROR_INVALID_ARGUMENT.AsInteger ());
58
- commandSenderObj = new chip::app::CommandSender (nullptr , nullptr );
58
+ commandSenderObj = new (std::nothrow) chip::app::CommandSender (nullptr , nullptr );
59
59
VerifyOrReturnError (commandSenderObj != nullptr , (CHIP_ERROR_NO_MEMORY).AsInteger ());
60
60
*commandSender = reinterpret_cast <uint64_t >(commandSenderObj);
61
61
return CHIP_NO_ERROR.AsInteger ();
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class TestQName
44
44
mStrings [i] = strdup (data[i]);
45
45
}
46
46
47
- mSerializedQNameBuffer = new uint8_t [neededSize];
47
+ mSerializedQNameBuffer = new (std::nothrow) uint8_t [neededSize];
48
48
VerifyOrDie (mSerializedQNameBuffer != nullptr );
49
49
50
50
chip::Encoding::BigEndian::BufferWriter writer (mSerializedQNameBuffer , neededSize);
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ int PacketBufferTest::TestSetup(void * inContext)
221
221
return FAILURE;
222
222
223
223
TestContext * const theContext = reinterpret_cast <TestContext *>(inContext);
224
- theContext->test = new PacketBufferTest (theContext);
224
+ theContext->test = new (std::nothrow) PacketBufferTest (theContext);
225
225
if (theContext->test == nullptr )
226
226
{
227
227
return FAILURE;
You can’t perform that action at this time.
0 commit comments