summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/socket.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 836a2b5de..e43055260 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -46,6 +46,7 @@ InspSocket* socket_ref[MAX_DESCRIPTORS];
InspSocket::InspSocket()
{
this->state = I_DISCONNECTED;
+ this->fd = -1;
}
InspSocket::InspSocket(int newfd, char* ip)
@@ -59,6 +60,7 @@ InspSocket::InspSocket(int newfd, char* ip)
InspSocket::InspSocket(std::string host, int port, bool listening, unsigned long maxtime)
{
+ this->fd = -1;
if (listening) {
if ((this->fd = OpenTCPSocket()) == ERROR)
{