From 7ab1081b3f9f8b4be6fcc224046bbed5723ce127 Mon Sep 17 00:00:00 2001 From: XinyuHou Date: Thu, 16 Apr 2015 11:55:05 +0100 Subject: [PATCH] Fixed server crash caused by double delete a socket #4535 --- src/lib/plugin/ns/SecureListenSocket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/plugin/ns/SecureListenSocket.cpp b/src/lib/plugin/ns/SecureListenSocket.cpp index 562a6899..86907608 100644 --- a/src/lib/plugin/ns/SecureListenSocket.cpp +++ b/src/lib/plugin/ns/SecureListenSocket.cpp @@ -55,7 +55,6 @@ SecureListenSocket::accept() m_socketMultiplexer, ARCH->acceptSocket(m_socket, NULL)); socket->initSsl(true); - m_secureSocketSet.insert(socket); if (socket != NULL) { setListeningJob(); @@ -78,6 +77,8 @@ SecureListenSocket::accept() socket->secureAccept(); + m_secureSocketSet.insert(socket); + return dynamic_cast(socket); } catch (XArchNetwork&) {