File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,11 +139,12 @@ char * rcl_get_secure_root(
139139 if (NULL == name ) {
140140 return NULL ;
141141 }
142-
142+
143+ const char * get_env_error_str = NULL ;
143144 // check if enclave override environment variable is empty
144- char * error_str = rcutils_get_env (ROS_SECURITY_ENCLAVE_OVERRIDE , & env_buf );
145- if (error_str ) {
146- RCUTILS_LOG_ERROR ("rcutils_get_env failed: %s\n" , error_str );
145+ get_env_error_str = rcutils_get_env (ROS_SECURITY_ENCLAVE_OVERRIDE , & env_buf );
146+ if (NULL != get_env_error_str ) {
147+ RCUTILS_LOG_ERROR ("rcutils_get_env failed: %s\n" , get_env_error_str );
147148 return NULL ;
148149 }
149150 if (!env_buf ) {
@@ -155,9 +156,9 @@ char * rcl_get_secure_root(
155156 char * ros_secure_enclave_override_env = rcutils_strdup (env_buf , * allocator );
156157
157158 // check if keystore environment variable is empty
158- char * error_str = rcutils_get_env (ROS_SECURITY_KEYSTORE_VAR_NAME , & env_buf );
159- if (error_str ) {
160- RCUTILS_LOG_ERROR ("rcutils_get_env failed: %s\n" , error_str );
159+ get_env_error_str = rcutils_get_env (ROS_SECURITY_KEYSTORE_VAR_NAME , & env_buf );
160+ if (NULL != get_env_error_str ) {
161+ RCUTILS_LOG_ERROR ("rcutils_get_env failed: %s\n" , get_env_error_str );
161162 allocator -> deallocate (ros_secure_enclave_override_env , allocator -> state );
162163 return NULL ;
163164 }
You can’t perform that action at this time.
0 commit comments