Skip to content

Commit

Permalink
Fix redefinition of get_env_error_str
Browse files Browse the repository at this point in the history
Signed-off-by: ruffsl <roxfoxpox@gmail.com>
  • Loading branch information
ruffsl committed Apr 16, 2020
1 parent 3e067b4 commit 68a356e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions rcl/src/rcl/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ char * rcl_get_secure_root(
if (NULL == name) {
return NULL;
}


const char * get_env_error_str = NULL;
// check if enclave override environment variable is empty
char * error_str = rcutils_get_env(ROS_SECURITY_ENCLAVE_OVERRIDE, &env_buf);
if (error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", error_str);
get_env_error_str = rcutils_get_env(ROS_SECURITY_ENCLAVE_OVERRIDE, &env_buf);
if (NULL != get_env_error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", get_env_error_str);
return NULL;
}
if (!env_buf) {
Expand All @@ -155,9 +156,9 @@ char * rcl_get_secure_root(
char * ros_secure_enclave_override_env = rcutils_strdup(env_buf, *allocator);

// check if keystore environment variable is empty
char * error_str = rcutils_get_env(ROS_SECURITY_KEYSTORE_VAR_NAME, &env_buf);
if (error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", error_str);
get_env_error_str = rcutils_get_env(ROS_SECURITY_KEYSTORE_VAR_NAME, &env_buf);
if (NULL != get_env_error_str) {
RCUTILS_LOG_ERROR("rcutils_get_env failed: %s\n", get_env_error_str);
allocator->deallocate(ros_secure_enclave_override_env, allocator->state);
return NULL;
}
Expand Down

0 comments on commit 68a356e

Please sign in to comment.