Skip to content

Commit c2212d1

Browse files
y-okumura-ispBlast545
authored andcommitted
Fix alloc-dealloc-mismatch(new->free) in test_info_by_topic (#469) (#569)
Signed-off-by: y-okumura-isp <[email protected]> Signed-off-by: Jorge Perez <[email protected]>
1 parent f573b1a commit c2212d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rcl/test/rcl/test_info_by_topic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ TEST_F(
286286
this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t();
287287
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
288288
{
289-
free(this->topic_endpoint_info_array.info_array);
289+
delete this->topic_endpoint_info_array.info_array;
290290
});
291291
rcl_allocator_t allocator = rcl_get_default_allocator();
292292
const auto ret = rcl_get_publishers_info_by_topic(
@@ -308,7 +308,7 @@ TEST_F(
308308
this->topic_endpoint_info_array.info_array = new rmw_topic_endpoint_info_t();
309309
OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT(
310310
{
311-
free(this->topic_endpoint_info_array.info_array);
311+
delete this->topic_endpoint_info_array.info_array;
312312
});
313313
rcl_allocator_t allocator = rcl_get_default_allocator();
314314
const auto ret = rcl_get_subscriptions_info_by_topic(

0 commit comments

Comments
 (0)