Skip to content

Commit

Permalink
RDKB-54362: Fix Memory Leak in gtest (#200)
Browse files Browse the repository at this point in the history
Reason for change: Fix Memory leak in rbus code.
Test Procedure: Test and verified.
Risks: Medium
Priority: P1

Signed-off-by: Deepthi C Shetty <[email protected]>
  • Loading branch information
dshett549 authored Mar 26, 2024
1 parent 904b952 commit 2118a94
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions unittests/rbus_unit_test_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,17 +1132,19 @@ TEST_F(TestServer, rtmsg_rtConnection_CreateWithConfig_test3)

TEST_F(TestServer, rtmsg_rtConnection_SendResponse_test1)
{
char *name = "sample_test";
rtMessageHeader const* hdr = (const rtMessageHeader*)name;
rtMessageHeader hdr;
char* buff = "TestName";
rtError err;
rtMessage res;

rtConnection con;
rtConnection_Create(&con, "PROVIDER1", "unix:///tmp/rtrouted");
#ifdef MSG_ROUNDTRIP_TIME
rtMessageHeader_Init(&hdr);
#endif
rtMessage_Create(&res);
rtMessage_SetString(res, "reply", buff);
err = rtConnection_SendResponse(con, hdr, res, 1000);
err = rtConnection_SendResponse(con, &hdr, res, 1000);
EXPECT_EQ(err, RT_OK);
rtMessage_Release(res);
rtConnection_Destroy(con);
Expand Down

0 comments on commit 2118a94

Please sign in to comment.