From 4f62aeb27ebf1cb142d34121defe1a47e8a17444 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 19 Apr 2005 21:53:44 +0000 Subject: Fixed fd leaks git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1133 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 1 - src/modules/m_ident.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3