From fcc93c08f30dc71aa9f1803299c6328ff9d69169 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 13 Nov 2011 18:14:20 +0100 Subject: Securing double closes in Sockets. --- src/Socket.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Socket.cc b/src/Socket.cc index ba528aa..4ef9942 100644 --- a/src/Socket.cc +++ b/src/Socket.cc @@ -280,6 +280,8 @@ Balau::Socket::Socket(int fd) : m_fd(fd), m_connected(true), m_connecting(false) } void Balau::Socket::close() throw (GeneralException) { + if (m_fd < 0) + return; #ifdef _WIN32 closesocket(m_fd); WSACleanup(); -- cgit v1.2.3