Closed Bug 19303 Opened 27 years ago Closed 27 years ago

[MLK] Leaking nsHeaderEntry objects

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: beard, Assigned: rpotts)

References

()

Details

Here's a patch that fixes the reference counting problem. This code is awfully hard to maintain, as-is, but using an nsCOMPtr isn't easy due to the methods not using interface types. Index: mozilla/netwerk/protocol/http/src/nsHTTPHeaderArray.cpp =================================================================== RCS file: /cvsroot/mozilla/netwerk/protocol/http/src/nsHTTPHeaderArray.cpp,v retrieving revision 1.13 diff -c -2 -r1.13 nsHTTPHeaderArray.cpp *** nsHTTPHeaderArray.cpp 1999/11/06 03:31:46 1.13 --- nsHTTPHeaderArray.cpp 1999/11/19 01:39:44 *************** *** 148,151 **** --- 148,152 ---- entry->mValue.SetString(aValue); } + NS_IF_RELEASE(entry); return NS_OK;
Status: NEW → RESOLVED
Closed: 27 years ago
Resolution: --- → FIXED
I've just checked in a fix. I'm not sure why this code in particular is "awfully hard" to maintain. It is classic ref-counting code that cannot use nsCOMPtrs because concrete classes are used...
It's harder to maintain because if you add early returns, you'll miss the final NS_IF_RELEASE. I've seen cases like this all over the tree.
Bulk move of all Necko (to be deleted component) bugs to new Networking component.
verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.