From 4a2bc56abe43ed11283768584e0ca87f224e66ff Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 7 Apr 2005 01:33:11 +0000 Subject: 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 --- src/inspircd.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/inspircd.cpp') 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); } } } -- cgit v1.2.3