summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-19 21:53:44 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-19 21:53:44 +0000
commit4f62aeb27ebf1cb142d34121defe1a47e8a17444 (patch)
treec4386cfa878414a553b502e9a3109099795d221e /src
parent99caa2a956e428096fcd42d5fd3b89aeccb07491 (diff)
Fixed fd leaks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1133 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/dns.cpp1
-rw-r--r--src/modules/m_ident.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index 13a80311a..b676b7bde 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -180,7 +180,6 @@ void DNS::dns_init() { /* on first call only: populates servers4 struct with up
}
}
fclose(f);
-
}
void DNS::dns_init_2(const char* dnsserver) { /* populates servers4 struct with address from the given parameter */
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index 68934ae68..90a6f448a 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -100,6 +100,8 @@ class RFC1413
{
// ... so that error isnt fatal, like the rest.
Srv->Log(DEBUG,"Ident: connect failed for: "+std::string(user->ip));
+ close(this->fd);
+ shutdown(this->fd,2);
return false;
}
}
@@ -118,6 +120,8 @@ class RFC1413
{
timeout = true;
Srv->SendServ(u->fd,"NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using "+std::string(u->ident)+" instead.");
+ close(this->fd);
+ shutdown(this->fd,2);
return false;
}
pollfd polls;
@@ -147,6 +151,8 @@ class RFC1413
if ((getsockname(this->u->fd,(sockaddr*)&sock_us,&uslen) || getpeername(this->u->fd, (sockaddr*)&sock_them, &themlen)))
{
Srv->Log(DEBUG,"Ident: failed to get socket names, bailing to state 3");
+ close(this->fd);
+ shutdown(this->fd,2);
state = IDENT_STATE_DONE;
}
else