diff --git a/rclcpp/include/rclcpp/publisher_options.hpp b/rclcpp/include/rclcpp/publisher_options.hpp index dd24718fd7..dd2c228a94 100644 --- a/rclcpp/include/rclcpp/publisher_options.hpp +++ b/rclcpp/include/rclcpp/publisher_options.hpp @@ -71,7 +71,7 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase rcl_publisher_options_t to_rcl_publisher_options(const rclcpp::QoS & qos) const { - rcl_publisher_options_t result; + rcl_publisher_options_t result = rcl_publisher_get_default_options(); using AllocatorTraits = std::allocator_traits; using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc; auto message_alloc = std::make_shared(*this->get_allocator().get());