Fix alloc-dealloc-mismatch(new->free) in test_info_by_topic (#469) (#569)

Signed-off-by: y-okumura-isp <y-okumura@isp.co.jp>
This commit is contained in:
y-okumura-isp 2020-03-10 01:20:34 +09:00 committed by GitHub
parent 40ba55bc17
commit ec43777891
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -286,7 +286,7 @@ TEST_F(
this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t(); this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT( 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(); rcl_allocator_t allocator = rcl_get_default_allocator();
const auto ret = rcl_get_publishers_info_by_topic( const auto ret = rcl_get_publishers_info_by_topic(
@ -308,7 +308,7 @@ TEST_F(
this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t(); this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t();
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT( 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(); rcl_allocator_t allocator = rcl_get_default_allocator();
const auto ret = rcl_get_subscriptions_info_by_topic( const auto ret = rcl_get_subscriptions_info_by_topic(