diff --git a/libuavcan/include/uavcan/internal/lazy_constructor.hpp b/libuavcan/include/uavcan/internal/lazy_constructor.hpp index d20b37a072..03bd2963ce 100644 --- a/libuavcan/include/uavcan/internal/lazy_constructor.hpp +++ b/libuavcan/include/uavcan/internal/lazy_constructor.hpp @@ -42,11 +42,14 @@ class LazyConstructor public: LazyConstructor() : ptr_(NULL) - { } + { + std::fill(data_, data_ + sizeof(T), 0); + } LazyConstructor(const LazyConstructor& rhs) : ptr_(NULL) { + std::fill(data_, data_ + sizeof(T), 0); if (rhs) construct(*rhs); // Invoke copy constructor }