Skip to content

Commit

Permalink
Use zero_allocate where needed.
Browse files Browse the repository at this point in the history
Signed-off-by: Franco Cipollone <[email protected]>
  • Loading branch information
francocipollone committed Jan 3, 2024
1 parent b0940f1 commit a414685
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,8 @@ rmw_create_client(
}

// client data
rmw_client_t * rmw_client = static_cast<rmw_client_t *>(allocator->allocate(
rmw_client_t * rmw_client = static_cast<rmw_client_t *>(allocator->zero_allocate(
1,
sizeof(rmw_client_t),
allocator->state));
RMW_CHECK_FOR_NULL_WITH_MSG(
Expand Down Expand Up @@ -2150,7 +2151,8 @@ rmw_create_service(
// SERVICE DATA ==============================================================
rcutils_allocator_t * allocator = &node->context->options.allocator;

rmw_service_t * rmw_service = static_cast<rmw_service_t *>(allocator->allocate(
rmw_service_t * rmw_service = static_cast<rmw_service_t *>(allocator->zero_allocate(
1,
sizeof(rmw_service_t),
allocator->state));
RMW_CHECK_FOR_NULL_WITH_MSG(
Expand Down

0 comments on commit a414685

Please sign in to comment.