Closed Bug 246329 Opened 20 years ago Closed 20 years ago

SchemeIs failure leaks nsHttpChannel

Categories

(Core :: Networking: HTTP, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8alpha2

People

(Reporter: Biesinger, Assigned: darin.moz)

References

()

Details

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

Attachments

(1 file)

in nsHttpHandler::NewProxiedChannel:
1346     NS_NEWXPCOM(httpChannel, nsHttpChannel);
1347     if (!httpChannel)
1348         return NS_ERROR_OUT_OF_MEMORY;
1349     NS_ADDREF(httpChannel);
1350 
1351     nsresult rv;
1352 
1353     PRBool https;
1354     rv = uri->SchemeIs("https", &https);
1355     if (NS_FAILED(rv)) return rv;

so if SchemeIs fails, httpChannel will never get deleted.
I'd suggest moving the schemeIs call above NS_NEWXPCOM.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha2
Attached patch v1 patchSplinter Review
Attachment #150524 - Flags: review?(cbiesinger)
Attachment #150524 - Flags: review?(cbiesinger) → review+
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 #150524 - Flags: approval1.7.1?
Comment on attachment 150524 [details] [diff] [review]
v1 patch

sr/a=sspitzer for 1.7.1.

curious, did someone actually see this leak, or did someone find it while
looking at the code?

my guess is that if they saw it in action, we passed in null for the first arg,
which sounds like broken code.
Attachment #150524 - Flags: superreview+
Attachment #150524 - Flags: approval1.7.1?
Attachment #150524 - Flags: approval1.7.1+
fixed1.7.1
Keywords: fixed1.7.1
Flags: blocking1.7.1?
Keywords: mlk
someone found this while looking at the code.

> my guess is that if they saw it in action, we passed in null for the first arg,

actually no, since _that_ would've lead to a crash. well... I guess you could
call this a shutdown leak of this channel. ;)
It does not chekin to AVIARY_1_0_20040515_BRANCH.
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: