Skip to content

Commit

Permalink
Fix memory leak of 56 bytes in test_graph
Browse files Browse the repository at this point in the history
test_rcl_get_publisher_names_and_types_by_node was finalizing
without calling to rcl_names_and_types_fini which was
generating a memory leak.

These lines fix the leak. Complete report in the pull request
  • Loading branch information
vmayoral committed Jun 30, 2019
1 parent e9a71b4 commit ec0e62c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rcl/test/rcl/test_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ TEST_F(
this->node_ptr, &allocator, false, this->test_graph_node_name, "", &nat);
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
rcl_reset_error();

ret = rcl_names_and_types_fini(&nat);
EXPECT_EQ(RCL_RET_OK, ret) << rcl_get_error_string().str;
}

/* Test the rcl_get_subscriber_names_and_types_by_node function.
Expand Down

0 comments on commit ec0e62c

Please sign in to comment.