Closed
Bug 1031920
Opened 11 years ago
Closed 11 years ago
If JS_NewArrayBufferWithContents fails, ArrayBufferBuilder::getArrayBuffer calls js_free(nullptr)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: smaug, Assigned: mz_mhs-ctb)
References
Details
(Keywords: memory-leak, Whiteboard: [MemShrink])
Attachments
(1 file, 1 obsolete file)
970 bytes,
patch
|
mz_mhs-ctb
:
review+
|
Details | Diff | Splinter Review |
http://hg.mozilla.org/mozilla-central/rev/ebdd57580809 looks odd.
1.11 JSObject* obj = JS_NewArrayBufferWithContents(aCx, mLength, mDataPtr);
1.12 + mDataPtr = nullptr;
1.13 + mLength = mCapacity = 0;
1.14 if (!obj) {
1.15 + js_free(mDataPtr);
1.16 return nullptr;
1.17 }
We set mDataPtr to null and then if obj is null, try to free mDataPtr.
Comment 1•11 years ago
|
||
Yeah, it looks like this will leak whatever was in mDataPtr on failure.
Assignee: nobody → mz_mhs-ctb
Attachment #8448490 -
Flags: review?(bugs)
Reporter | ||
Updated•11 years ago
|
Attachment #8448490 -
Flags: review?(bugs) → review+
Attachment #8448490 -
Attachment is obsolete: true
Attachment #8448764 -
Flags: review+
Keywords: checkin-needed
Comment 4•11 years ago
|
||
Hi Michael,
could you provide a try run for this checkin? Thanks!
Keywords: checkin-needed
Unfortunately no, don't have commit access.
Flags: needinfo?(cbook)
Comment 6•11 years ago
|
||
I'll do a try run today and set checkin needed when it is done.
Flags: needinfo?(cbook) → needinfo?(continuation)
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Sorry this took so long, our test infrastructure was really backed up for some reason. Try run is green.
Flags: needinfo?(continuation)
Keywords: checkin-needed
Comment 9•11 years ago
|
||
Keywords: checkin-needed
Comment 10•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•