Skip to content

Commit

Permalink
Fixed a couple of memory leaks in chip-im-initiator and echo-requeste…
Browse files Browse the repository at this point in the history
…r example apps. (#13216)
  • Loading branch information
harsha-rajendran authored and pull[bot] committed Feb 26, 2022
1 parent 2cc666a commit e0707e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/tests/integration/chip_im_initiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class MockInteractionModelApp : public chip::app::InteractionModelDelegate,
gLastCommandResult = TestCommandResult::kFailure;
printf("CommandResponseError happens with %" CHIP_ERROR_FORMAT, aError.Format());
}
void OnDone(chip::app::CommandSender * apCommandSender) override {}
void OnDone(chip::app::CommandSender * apCommandSender) override { delete apCommandSender; }

void OnResponse(const chip::app::WriteClient * apWriteClient, const chip::app::ConcreteAttributePath & path,
chip::app::StatusIB status) override
Expand Down Expand Up @@ -445,6 +445,10 @@ CHIP_ERROR EstablishSecureSession()
{
printf("Establish secure session succeeded\n");
}
if (testSecurePairingSecret)
{
chip::Platform::Delete(testSecurePairingSecret);
}

return err;
}
Expand Down
4 changes: 4 additions & 0 deletions src/messaging/tests/echo/echo_requester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ CHIP_ERROR EstablishSecureSession()
{
printf("Establish secure session succeeded\n");
}
if (testSecurePairingSecret)
{
chip::Platform::Delete(testSecurePairingSecret);
}

return err;
}
Expand Down

0 comments on commit e0707e6

Please sign in to comment.