Closed Bug 252345 Opened 20 years ago Closed 20 years ago

Memory leak in nsXMLHttpRequest.cpp (seen when using GMail)

Categories

(Core Graveyard :: Web Services, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pkwarren, Assigned: pkwarren)

References

Details

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

Attachments

(1 file)

In nsXMLHttpRequest::ConvertBodyToText, a PRUnichar string is allocated with nsMemory::Alloc, assigned into a returned buffer, but never freed. Here is the trace from valgrind: 4244 bytes in 1 blocks are definitely lost in loss record 463 of 528 at 0x1B9046D0: malloc (vg_replace_malloc.c:109) by 0x1B9E28AF: PR_Malloc (prmem.c:436) by 0x1BE7860B: nsMemoryImpl::Alloc(unsigned) (nsMemoryImpl.cpp:325) by 0x8080EE6: nsMemory::Alloc(unsigned) (nsMemory.cpp:87) by 0x1C50632A: nsXMLHttpRequest::ConvertBodyToText(nsAString&) (nsXMLHttpRequest.cpp:553) by 0x1C506597: nsXMLHttpRequest::GetResponseText(nsAString&) (nsXMLHttpRequest.cpp:605) by 0x1BE8F600: XPTC_InvokeByIndex (xptcinvoke_gcc_x86_unix.cpp:69) by 0x1C915CB6: XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) (xpcwrappednative.cpp:2027) by 0x1C92116F: XPCWrappedNative::GetAttribute(XPCCallContext&) (xpcprivate.h:1887) by 0x1C920044: XPC_WN_GetterSetter(JSContext*, JSObject*, unsigned, long*, long*) (xpcwrappednativejsops.cpp:1319)
Attached patch Patch v1Splinter Review
Assignee: web-services → pkwarren
Status: NEW → ASSIGNED
Attachment #153835 - Flags: review?(peterv)
in the old days one might have used adopt if the allocator fit...
Attachment #153835 - Flags: review?(peterv) → review+
Attachment #153835 - Flags: superreview?(darin)
Attachment #153835 - Flags: superreview?(darin) → superreview+
Fixed. Checking in nsXMLHttpRequest.cpp; /cvsroot/mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp,v <-- nsXMLHttpRequest.cpp new revision: 1.115; previous revision: 1.114 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
It is a fixed memory leak bug, could it be considered for 1.7.2 ?
Flags: blocking1.7.2?
(In reply to comment #2) > in the old days one might have used adopt if the allocator fit... Adopt is not a method on nsAString unfortunately :-(
1.7.3 is done, I'd like this small memory leak to be fixed for Firefox 1.0
Flags: blocking1.7.x? → blocking-aviary1.0?
Attachment #153835 - Flags: approval1.7.x?
*** Bug 264901 has been marked as a duplicate of this bug. ***
Comment on attachment 153835 [details] [diff] [review] Patch v1 Whoa. Given gmail, I think we should get this on the branches. Are there any known regressions?
Attachment #153835 - Flags: approval-aviary?
Comment on attachment 153835 [details] [diff] [review] Patch v1 a=asa for branches checkins.
Attachment #153835 - Flags: approval1.7.x?
Attachment #153835 - Flags: approval1.7.x+
Attachment #153835 - Flags: approval-aviary?
Attachment #153835 - Flags: approval-aviary+
Checked in on 1.7/aviary branches.
Flags: blocking-aviary1.0?
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: