Skip to content

Commit

Permalink
Adding Null check node_secure_root
Browse files Browse the repository at this point in the history
  • Loading branch information
ruffsl committed Nov 5, 2018
1 parent 4ea470f commit 5b8c5c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rcl/src/rcl/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ const char * rcl_get_secure_root(
allocator->deallocate(node_fqn, allocator->state);
allocator->deallocate(node_root_path, allocator->state);
}
if (!rcutils_is_directory(node_secure_root)) {
// Check node_secure_root is not NULL before checking directory
if (NULL == node_secure_root) {
allocator->deallocate(node_secure_root, allocator->state);
return NULL;
} else if (!rcutils_is_directory(node_secure_root)) {
allocator->deallocate(node_secure_root, allocator->state);
return NULL;
}
Expand Down

0 comments on commit 5b8c5c7

Please sign in to comment.