From a572e09cc5549dad9ace96dd1cc29208634ab4d1 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 1 Jul 2010 19:24:43 -0600 Subject: [PATCH] Fix context leak in HttpStateData::processReplyHeader --- src/http.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); - } /** -- 2.47.3