optimize to avoid potential issue from uninitialized scalar variable (#183)

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
This commit is contained in:
Ethan Gao 2017-11-17 04:41:33 +08:00 committed by Karsten Knese
parent ddc172a7e6
commit 2079097227
2 changed files with 2 additions and 0 deletions

View file

@ -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;