summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-14 11:43:17 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-14 11:43:17 +0000
commitccb1837a1481ed3d9048f2e4d0d5d6309f14d17d (patch)
treea0e0dea848b3af6f81cb72f5ff64a21d43214b1b /src/users.cpp
parent45216ce4311f7dbe6ec7c8227152017449ea3336 (diff)
Fix dns socket leak found in stable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4383 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/users.cpp b/src/users.cpp
index f455bb825..4918c417b 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -202,7 +202,9 @@ userrec::userrec()
invites.clear();
chans.resize(MAXCHANS);
memset(modes,0,sizeof(modes));
-
+#ifndef THREADED_DNS
+ dns_fd = -1;
+#endif
for (unsigned int n = 0; n < MAXCHANS; n++)
{
ucrec* x = new ucrec();
@@ -219,6 +221,11 @@ userrec::~userrec()
ucrec* x = (ucrec*)*n;
DELETE(x);
}
+ if (dns_fd > -1)
+ {
+ shutdown(dns_fd, 2);
+ close(dns_fd);
+ }
}
/* XXX - minor point, other *Host functions return a char *, this one creates it. Might be nice to be consistant? */