Skip to content

Commit

Permalink
Fix memory leak in parse_key in parser.c
Browse files Browse the repository at this point in the history
Signed-off-by: y-okumura-isp <[email protected]>
  • Loading branch information
y-okumura-isp committed Jan 31, 2020
1 parent d97163f commit 142ef35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rcl_yaml_param_parser/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,9 @@ static rcutils_ret_t parse_key(
break;
}

ret = rem_name_from_ns(ns_tracker, NS_TYPE_NODE, allocator);
allocator.deallocate(node_name_ns, allocator.state);

ret = rem_name_from_ns(ns_tracker, NS_TYPE_NODE, allocator);
if (RCUTILS_RET_OK != ret) {
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(
"Internal error adding node namespace at line %d", line_num);
Expand Down

0 comments on commit 142ef35

Please sign in to comment.