From: Amos Jeffries Date: Mon, 20 Apr 2020 01:06:54 +0000 (+0000) Subject: Reduce Pointer refcounting in forwarding (#592) X-Git-Tag: 4.15-20210522-snapshot~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d74b4b888d6e9c51bc5897839a24cfd0bea2d5b;p=thirdparty%2Fsquid.git Reduce Pointer refcounting in forwarding (#592) Remove temporary Pointer copy which confused Coverity scan into thinking there is a double-free. Should resolve Issue #1461170 and maybe others. --- diff --git a/src/FwdState.cc b/src/FwdState.cc index 91e0412e13..e08781d9a0 100644 --- a/src/FwdState.cc +++ b/src/FwdState.cc @@ -1353,7 +1353,7 @@ aclFindNfMarkConfig(acl_nfmark * head, ACLChecklist * ch) } void -getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn) +getOutgoingAddress(HttpRequest * request, const Comm::ConnectionPointer &conn) { // skip if an outgoing address is already set. if (!conn->local.isAnyAddr()) return; diff --git a/src/FwdState.h b/src/FwdState.h index ae1434d08b..6881726747 100644 --- a/src/FwdState.h +++ b/src/FwdState.h @@ -197,7 +197,7 @@ private: PconnRace pconnRace; ///< current pconn race state }; -void getOutgoingAddress(HttpRequest * request, Comm::ConnectionPointer conn); +void getOutgoingAddress(HttpRequest * request, const Comm::ConnectionPointer &conn); /// a collection of previously used persistent Squid-to-peer HTTP(S) connections extern PconnPool *fwdPconnPool;