From: Amos Jeffries Date: Tue, 25 Aug 2015 12:51:31 +0000 (-0700) Subject: Fix memory leak in Surrogate-Capability header detection X-Git-Tag: SQUID_4_0_1~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf574df8378c3d4f99b6071daed57aec9f844e98;p=thirdparty%2Fsquid.git Fix memory leak in Surrogate-Capability header detection Detected by Coverity Scan. Issue 1318023 --- diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index 106877d257..9cd4ca78b8 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -2283,14 +2283,12 @@ esiEnableProcessing (HttpReply *rep) HttpHdrScTarget *sctusable = rep->surrogate_control->getMergedTarget(Config.Accel.surrogate_id); - if (!sctusable || !sctusable->hasContent()) - /* Nothing generic or targeted at us, or no - * content processing requested - */ - return 0; - - if (sctusable->content().pos("ESI/1.0") != NULL) + // found something targeted at us + if (sctusable && + sctusable->hasContent() && + sctusable->content().pos("ESI/1.0")) { rv = 1; + } delete sctusable; }