From: Amos Jeffries Date: Mon, 28 Jun 2010 05:13:07 +0000 (+1200) Subject: Fix context leak in HttpStateData::processReplyHeader X-Git-Tag: SQUID_3_2_0_1~112 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=859f1666c5afd26a1ac2ea9f8d23f880dd86641a;p=thirdparty%2Fsquid.git Fix context leak in HttpStateData::processReplyHeader --- diff --git a/src/http.cc b/src/http.cc index 132332a435..2b2f1f683f 100644 --- a/src/http.cc +++ b/src/http.cc @@ -653,13 +653,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; @@ -745,7 +750,6 @@ HttpStateData::processReplyHeader() orig_request->hier.peer_reply_status = newrep->sline.status; ctx_exit(ctx); - } /**