From c1d123d1775b18af436c360b75d34fb92bbf5d86 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 23 Sep 2019 15:57:08 -0700 Subject: [PATCH] [mle] remove memset from DelayedResponseHeader constructors (#4195) --- src/core/thread/mle.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index 34ad46d7e..32643c8d5 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -367,7 +367,12 @@ public: * Default constructor for the object. * */ - DelayedResponseHeader(void) { memset(this, 0, sizeof(*this)); } + DelayedResponseHeader(void) + : mDestination() + , mSendTime(0) + { + mDestination.Clear(); + } /** * This constructor initializes the object with specific values. @@ -377,9 +382,9 @@ public: * */ DelayedResponseHeader(TimeMilli aSendTime, const Ip6::Address &aDestination) + : mDestination(aDestination) + , mSendTime(aSendTime) { - mSendTime = aSendTime; - mDestination = aDestination; } /**