summaryrefslogtreecommitdiff
path: root/src/Socket.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-13 18:14:20 +0100
committerPixel <pixel@nobis-crew.org>2011-11-13 18:14:20 +0100
commitfcc93c08f30dc71aa9f1803299c6328ff9d69169 (patch)
tree4d46125b2278e61e334fbde5cd685bc762714266 /src/Socket.cc
parente6385cb74c35eb5a346237acecc846e52c4d6bd4 (diff)
Securing double closes in Sockets.
Diffstat (limited to 'src/Socket.cc')
-rw-r--r--src/Socket.cc2
1 files changed, 2 insertions, 0 deletions
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();