Skip to content

Commit

Permalink
optimize to avoid potential issue from uninitialized scalar variable (#…
Browse files Browse the repository at this point in the history
…183)

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
  • Loading branch information
gaoethan authored and Karsten1987 committed Nov 16, 2017
1 parent ddc172a commit 2079097
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions rcl_lifecycle/src/com_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ rcl_lifecycle_com_interface_t
rcl_lifecycle_get_zero_initialized_com_interface()
{
rcl_lifecycle_com_interface_t com_interface;
com_interface.node_handle = NULL;
com_interface.pub_transition_event = rcl_get_zero_initialized_publisher();
com_interface.srv_change_state = rcl_get_zero_initialized_service();
com_interface.srv_get_state = rcl_get_zero_initialized_service();
Expand Down
1 change: 1 addition & 0 deletions rcl_lifecycle/src/rcl_lifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rcl_lifecycle_state_machine_t
rcl_lifecycle_get_zero_initialized_state_machine()
{
rcl_lifecycle_state_machine_t state_machine;
state_machine.current_state = NULL;
state_machine.transition_map = rcl_lifecycle_get_zero_initialized_transition_map();
state_machine.com_interface = rcl_lifecycle_get_zero_initialized_com_interface();
return state_machine;
Expand Down

0 comments on commit 2079097

Please sign in to comment.