Skip to content

Commit ced0c02

Browse files
Fix memory leak in test.
1 parent 70dfe61 commit ced0c02

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/app/tests/TestReadInteraction.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -4116,13 +4116,12 @@ void TestReadInteraction::TestSubscriptionReportWithDefunctSession(nlTestSuite *
41164116
err = engine->Init(&ctx.GetExchangeManager(), &ctx.GetFabricTable());
41174117
NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR);
41184118

4119+
AttributePathParams subscribePath(Test::kMockEndpoint3, Test::MockClusterId(2), Test::MockAttributeId(4));
4120+
41194121
ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice());
4120-
readPrepareParams.mpAttributePathParamsList = new chip::app::AttributePathParams[1];
4122+
readPrepareParams.mpAttributePathParamsList = &subscribePath;
41214123
readPrepareParams.mAttributePathParamsListSize = 1;
41224124

4123-
AttributePathParams subscribePath(Test::kMockEndpoint3, Test::MockClusterId(2), Test::MockAttributeId(4));
4124-
readPrepareParams.mpAttributePathParamsList[0] = subscribePath;
4125-
41264125
readPrepareParams.mMinIntervalFloorSeconds = 0;
41274126
readPrepareParams.mMaxIntervalCeilingSeconds = 0;
41284127

0 commit comments

Comments
 (0)