Zero initialize guard condition on failed init. (#760)

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
This commit is contained in:
Michel Hidalgo 2020-08-25 12:43:32 -03:00 committed by Alejandro Hernández Cordero
parent 8d7bb9fe65
commit 6d32b6767e

View file

@ -87,6 +87,7 @@ __rcl_guard_condition_init_from_rmw_impl(
if (!guard_condition->impl->rmw_handle) {
// Deallocate impl and exit.
allocator->deallocate(guard_condition->impl, allocator->state);
guard_condition->impl = NULL;
RCL_SET_ERROR_MSG(rmw_get_error_string().str);
return RCL_RET_ERROR;
}