Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit fbfb300

Browse files
authored
Merge pull request #30 from ARMmbed/IOTCLT-961
Fix for IOTCLT-961
2 parents 3f85743 + b222048 commit fbfb300

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/m2mconnectionhandlerpimpl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ M2MConnectionHandlerPimpl::M2MConnectionHandlerPimpl(M2MConnectionHandler* base,
116116
M2MConnectionHandlerPimpl::~M2MConnectionHandlerPimpl()
117117
{
118118
tr_debug("M2MConnectionHandlerPimpl::~M2MConnectionHandlerPimpl()");
119+
if(_socket_address) {
120+
delete _socket_address;
121+
_socket_address = NULL;
122+
}
119123
if (_socket) {
120124
delete _socket;
121125
_socket = 0;
@@ -162,6 +166,10 @@ bool M2MConnectionHandlerPimpl::resolve_server_address(const String& server_addr
162166
void M2MConnectionHandlerPimpl::dns_handler()
163167
{
164168
tr_debug("M2MConnectionHandlerPimpl::dns_handler()");
169+
if(_socket_address) {
170+
delete _socket_address;
171+
_socket_address = NULL;
172+
}
165173
_socket_address = new SocketAddress(_net_iface,_server_address.c_str(), _server_port);
166174
if(*_socket_address) {
167175
_address._address = (void*)_socket_address->get_ip_address();

0 commit comments

Comments
 (0)