From: Amos Jeffries Date: Sat, 4 Jul 2015 11:36:00 +0000 (-0700) Subject: Fix crash in TcpAccepter with profiler enabled X-Git-Tag: merge-candidate-3-v1~52^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6558fd545a3946f79b446a1444bb6605d9d584de;p=thirdparty%2Fsquid.git Fix crash in TcpAccepter with profiler enabled --- diff --git a/src/comm/TcpAcceptor.cc b/src/comm/TcpAcceptor.cc index 15e3e40cf1..ce96f16caf 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; }