From 451852d19f7a921870fe1d43e2e81d36abcf7042 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Wed, 5 Sep 2018 12:00:59 +0300 Subject: [PATCH] Fix TCPSocket::accept() This one was actually always return NULL, and unsted because we only have tests with one device. We will add the testcase for this soon --- features/netsocket/TCPSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/netsocket/TCPSocket.cpp b/features/netsocket/TCPSocket.cpp index 00bac9a3f9..dc304070ee 100644 --- a/features/netsocket/TCPSocket.cpp +++ b/features/netsocket/TCPSocket.cpp @@ -265,7 +265,7 @@ TCPSocket *TCPSocket::accept(nsapi_error_t *error) ret = _stack->socket_accept(_socket, &socket, &address); if (0 == ret) { - TCPSocket *connection = new TCPSocket(); + connection = new TCPSocket(); connection->_lock.lock(); connection->_factory_allocated = true; // Destroy automatically on close() connection->_remote_peer = address;