From: Amos Jeffries Date: Fri, 2 Jul 2010 01:24:43 +0000 (-0600) Subject: Fix context leak in HttpStateData::processReplyHeader X-Git-Tag: SQUID_3_1_5~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a572e09cc5549dad9ace96dd1cc29208634ab4d1;p=thirdparty%2Fsquid.git Fix context leak in HttpStateData::processReplyHeader --- diff --git a/src/http.cc b/src/http.cc index e213082930..6f8b5b45d4 100644 --- a/src/http.cc +++ b/src/http.cc @@ -656,13 +656,18 @@ void HttpStateData::processReplyHeader() { /** Creates a blank header. If this routine is made incremental, this will not do */ + + /* NP: all exit points to this function MUST call ctx_exit(ctx) */ Ctx ctx = ctx_enter(entry->mem_obj->url); + debugs(11, 3, "processReplyHeader: key '" << entry->getMD5Text() << "'"); assert(!flags.headers_parsed); - if (!readBuf->hasContent()) + if (!readBuf->hasContent()) { + ctx_exit(ctx); return; + } http_status error = HTTP_STATUS_NONE; @@ -748,7 +753,6 @@ HttpStateData::processReplyHeader() orig_request->hier.peer_reply_status = newrep->sline.status; ctx_exit(ctx); - } /**