From 924df683b979393eac7814e4e825806704dbfa39 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 9 Nov 2017 09:02:06 -0500 Subject: [PATCH] rcutils_join_path returns a char * now. (#173) Thus, we no longer need to cast away the const when freeing it. Signed-off-by: Chris Lalancette --- rmw_fastrtps_cpp/src/rmw_node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rmw_fastrtps_cpp/src/rmw_node.cpp b/rmw_fastrtps_cpp/src/rmw_node.cpp index 799db7250..537cd49d7 100644 --- a/rmw_fastrtps_cpp/src/rmw_node.cpp +++ b/rmw_fastrtps_cpp/src/rmw_node.cpp @@ -169,7 +169,7 @@ get_security_file_paths( std::string file_prefix("file://"); for (size_t i = 0; i < num_files; i++) { - const char * file_path = rcutils_join_path(node_secure_root, file_names[i]); + char * file_path = rcutils_join_path(node_secure_root, file_names[i]); if (!file_path) { return false; } @@ -177,11 +177,11 @@ get_security_file_paths( if (rcutils_is_readable(file_path)) { security_files_paths[i] = file_prefix + std::string(file_path); } else { - free(const_cast(file_path)); + free(file_path); return false; } - free(const_cast(file_path)); + free(file_path); } return true;