------------------------------------------------------------ revno: 13902 revision-id: squid3@treenet.co.nz-20150829201341-m9eus7fyw30ybh3x parent: squid3@treenet.co.nz-20150829201119-gdxtxfv3romi6j80 committer: Amos Jeffries branch nick: 3.5 timestamp: Sat 2015-08-29 13:13:41 -0700 message: Fix memory leak in Surrogate-Capability header detection Detected by Coverity Scan. Issue 1318023 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20150829201341-m9eus7fyw30ybh3x # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 748f05db48a8373167a501c605ba0527083d9405 # timestamp: 2015-08-29 20:24:10 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20150829201119-\ # gdxtxfv3romi6j80 # # Begin patch === modified file 'src/esi/Esi.cc' --- src/esi/Esi.cc 2015-01-19 11:50:22 +0000 +++ src/esi/Esi.cc 2015-08-29 20:13:41 +0000 @@ -2408,14 +2408,12 @@ 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; }