Skip to content

Commit

Permalink
rcutils_join_path returns a char * now. (#173)
Browse files Browse the repository at this point in the history
Thus, we no longer need to cast away the const when freeing it.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette authored Nov 9, 2017
1 parent 425914d commit 924df68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rmw_fastrtps_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,19 @@ 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;
}

if (rcutils_is_readable(file_path)) {
security_files_paths[i] = file_prefix + std::string(file_path);
} else {
free(const_cast<char *>(file_path));
free(file_path);
return false;
}

free(const_cast<char *>(file_path));
free(file_path);
}

return true;
Expand Down

0 comments on commit 924df68

Please sign in to comment.