rcutils_join_path now returns a char *. (#174)

So we no longer have to cast away the const when freeing the
memory.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
This commit is contained in:
Chris Lalancette 2017-11-09 09:01:59 -05:00 committed by GitHub
parent ffcfc34890
commit 9f2010d6f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,9 +69,9 @@ const char * rcl_get_secure_root(const char * node_name)
if (!ros_secure_root_size) {
return NULL; // environment variable was empty
}
const char * node_secure_root = rcutils_join_path(ros_secure_root_env, node_name);
char * node_secure_root = rcutils_join_path(ros_secure_root_env, node_name);
if (!rcutils_is_directory(node_secure_root)) {
free((char *)node_secure_root);
free(node_secure_root);
return NULL;
}
return node_secure_root;