summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-07 01:33:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-07 01:33:11 +0000
commit4a2bc56abe43ed11283768584e0ca87f224e66ff (patch)
tree6ea31de5a155ecdb536824a3280cef3030f8121a /src/inspircd.cpp
parent669f7bb7dd8008ee80e3351e8f186696c8a75178 (diff)
Fixed a double free in dnsqueue.cpp
Fixed a resolver issue (weird segfault on gentoo?) in server linking git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@995 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index c129fc039..64ba6a8c1 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -3512,14 +3512,17 @@ int InspIRCd(void)
char remotehost[MAXBUF],resolved[MAXBUF];
length = sizeof (client);
incomingSockfd = accept (me[x]->fd, (sockaddr *) &client, &length);
- strlcpy(remotehost,(char *)inet_ntoa(client.sin_addr),MAXBUF);
- if(CleanAndResolve(resolved, remotehost) != TRUE)
+ if (incomingSockfd != -1)
{
- strlcpy(resolved,remotehost,MAXBUF);
+ strlcpy(remotehost,(char *)inet_ntoa(client.sin_addr),MAXBUF);
+ if(CleanAndResolve(resolved, remotehost) != TRUE)
+ {
+ strlcpy(resolved,remotehost,MAXBUF);
+ }
+ // add to this connections ircd_connector vector
+ // *FIX* - we need the LOCAL port not the remote port in &client!
+ me[x]->AddIncoming(incomingSockfd,resolved,me[x]->port);
}
- // add to this connections ircd_connector vector
- // *FIX* - we need the LOCAL port not the remote port in &client!
- me[x]->AddIncoming(incomingSockfd,resolved,me[x]->port);
}
}
}