[udp6] initialize Socket variables in its constructor (#5902)

This commit is contained in:
Shu Chen
2020-12-02 22:08:27 -08:00
committed by GitHub
parent 6088200bf0
commit ad67e8b47b
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ exit:
Udp::Socket::Socket(Instance &aInstance)
: InstanceLocator(aInstance)
{
mHandle = nullptr;
Clear();
}
Message *Udp::Socket::NewMessage(uint16_t aReserved, const Message::Settings &aSettings)
+2 -1
View File
@@ -39,6 +39,7 @@
#include <openthread/udp.h>
#include <openthread/platform/udp.h>
#include "common/clearable.hpp"
#include "common/linked_list.hpp"
#include "common/locator.hpp"
#include "common/non_copyable.hpp"
@@ -70,7 +71,7 @@ public:
* This class implements a UDP/IPv6 socket.
*
*/
class SocketHandle : public otUdpSocket, public LinkedListEntry<SocketHandle>
class SocketHandle : public otUdpSocket, public LinkedListEntry<SocketHandle>, public Clearable<SocketHandle>
{
friend class Udp;
friend class LinkedList<SocketHandle>;