Skip to content

Commit

Permalink
Fix alloc-dealloc-mismatch(new->free) in test_info_by_topic (ros2#469)
Browse files Browse the repository at this point in the history
Signed-off-by: y-okumura-isp <y-okumura@isp.co.jp>
  • Loading branch information
y-okumura-isp committed Feb 3, 2020
1 parent 7537f83 commit d3aa89a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rcl/test/rcl/test_info_by_topic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ TEST_F(CLASSNAME(TestInfoByTopicFixture, RMW_IMPLEMENTATION),
// and the info_array variable inside it is expected to be null.
this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
free(this->topic_endpoint_info_array.info_array);
delete this->topic_endpoint_info_array.info_array;
});
rcl_allocator_t allocator = rcl_get_default_allocator();
const auto ret = rcl_get_publishers_info_by_topic(&this->node,
Expand All @@ -284,7 +284,7 @@ TEST_F(CLASSNAME(TestInfoByTopicFixture, RMW_IMPLEMENTATION),
// and the info_array variable inside it is expected to be null.
this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT({
free(this->topic_endpoint_info_array.info_array);
delete this->topic_endpoint_info_array.info_array;
});
rcl_allocator_t allocator = rcl_get_default_allocator();
const auto ret = rcl_get_subscriptions_info_by_topic(&this->node,
Expand Down

0 comments on commit d3aa89a

Please sign in to comment.