Closed Bug 246264 Opened 20 years ago Closed 20 years ago

nsHttpChannel may leak mResponseHead

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.8alpha2

People

(Reporter: darin.moz, Assigned: darin.moz)

Details

(Keywords: fixed-aviary1.0, fixed1.7.5, memory-leak)

Attachments

(1 file)

nsHttpChannel may leak mResponseHead.

The leak happens here:

http://lxr.mozilla.org/mozilla/source/netwerk/protocol/http/src/nsHttpChannel.cpp#3533

mResponseHead is usually null, unless this is the second time this channel has
been used to perform a HTTP transaction.  Currently, that can only happen if we
are authenticating the user after prompting for username and password.
Attached patch v1 patchSplinter Review
This patch deletes mResponseHead in DoAuthRetry after we set mIsPending to
PR_TRUE.  The idea is to clear the response headers right before setting up the
next request.  I also added an assertion at the location of leak, which really
should have been there before :-)

Thanks to Javier for finding this leak.
Severity: normal → major
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha2
Attachment #150477 - Flags: review?(pedemont)
Comment on attachment 150477 [details] [diff] [review]
v1 patch

Yep, that took care of it for me.
Attachment #150477 - Flags: review?(pedemont) → review+
Attachment #150477 - Flags: superreview?(bryner)
Attachment #150477 - Flags: superreview?(bryner) → superreview+
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
It is a fixed memory leak bug, could it be considered for 1.7.1 ?
Flags: blocking1.7.1?
Attachment #150477 - Flags: approval1.7.1?
Comment on attachment 150477 [details] [diff] [review]
v1 patch

assuming no problems have come out on the trunk, a=sspitzer for 1.7.1
Attachment #150477 - Flags: approval1.7.1? → approval1.7.1+
fixed1.7.1
Keywords: fixed1.7.1
Flags: blocking1.7.1?
It does not chekin to AVIARY_1_0_20040515_BRANCH.
In order to raise quality, please chekin correction of MOZILLA_1_7_BRANCH to
AVIARY_1_0_20040515_BRANCH, without fail.
fixed-aviary1.0
Whiteboard: fixed-aviary1.0
Keywords: fixed-aviary1.0
Whiteboard: fixed-aviary1.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: