Fix leak of ns_with_separators

This commit is contained in:
Shane Loretz 2018-03-05 15:08:11 -08:00 committed by Shane Loretz
parent 31079577b8
commit beee7c22ee

View file

@ -93,10 +93,7 @@ const char * rcl_create_node_logger_name(
// Join the namespace and node name to create the logger name. // Join the namespace and node name to create the logger name.
char * node_logger_name = rcutils_format_string( char * node_logger_name = rcutils_format_string(
*allocator, "%s%s%s", ns_with_separators, RCUTILS_LOGGING_SEPARATOR_STRING, node_name); *allocator, "%s%s%s", ns_with_separators, RCUTILS_LOGGING_SEPARATOR_STRING, node_name);
if (NULL == node_logger_name) { allocator->deallocate((char *)ns_with_separators, allocator->state);
allocator->deallocate((char *)ns_with_separators, allocator->state);
return NULL;
}
return node_logger_name; return node_logger_name;
} }