From: Amos Jeffries Date: Thu, 16 Jul 2015 06:59:08 +0000 (-0700) Subject: Fix crash in TcpAccepter with profiler enabled X-Git-Tag: SQUID_3_5_7~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ac4c820fae461964b7a42e6cba6b167643134a7;p=thirdparty%2Fsquid.git Fix crash in TcpAccepter with profiler enabled --- diff --git a/src/comm/TcpAcceptor.cc b/src/comm/TcpAcceptor.cc index 0d5e46b583..c18ebc5c37 100644 --- a/src/comm/TcpAcceptor.cc +++ b/src/comm/TcpAcceptor.cc @@ -366,6 +366,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details) if (clientdbEstablished(details->remote, 0) > Config.client_ip_max_connections) { debugs(50, DBG_IMPORTANT, "WARNING: " << details->remote << " attempting more than " << Config.client_ip_max_connections << " connections."); Ip::Address::FreeAddr(gai); + PROF_stop(comm_accept); return Comm::COMM_ERROR; } } @@ -376,6 +377,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details) if (getsockname(sock, gai->ai_addr, &gai->ai_addrlen) != 0) { debugs(50, DBG_IMPORTANT, "ERROR: getsockname() failed to locate local-IP on " << details << ": " << xstrerror()); Ip::Address::FreeAddr(gai); + PROF_stop(comm_accept); return Comm::COMM_ERROR; } details->local = *gai; @@ -405,6 +407,7 @@ Comm::TcpAcceptor::oldAccept(Comm::ConnectionPointer &details) // Perform NAT or TPROXY operations to retrieve the real client/dest IP addresses if (conn->flags&(COMM_TRANSPARENT|COMM_INTERCEPTION) && !Ip::Interceptor.Lookup(details, conn)) { // Failed. + PROF_stop(comm_accept); return Comm::COMM_ERROR; }