From c16a553e9ddc4210f279114294545715f0d66a12 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 29 Aug 2015 13:13:41 -0700 Subject: [PATCH] Fix memory leak in Surrogate-Capability header detection Detected by Coverity Scan. Issue 1318023 --- src/esi/Esi.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index 789003707b..f87ce5481e 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -2408,14 +2408,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; } -- 2.47.2