Closed Bug 1145854 Opened 5 years ago Closed 5 years ago

Fix leak in WrapperOwner::className

Categories

(Core :: DOM: Content Processes, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: mrbkap, Assigned: mrbkap)

References

Details

(Whiteboard: [MemShrink])

Attachments

(1 file, 1 obsolete file)

BaseProxyHandler::className is supposed to return a 'const char *' that is owned by... someone. In practice all callers immediately copy the return value. CPOWs leak the return value, which shows up in LSan stats. I'd like to return a string that's valid for as long as the proxy object is alive.
Attached patch patch v1 (obsolete) — Splinter Review
WrapperAnswer::ToString uses NS_ConvertASCIItoUTF16.
Attachment #8580936 - Flags: review?(wmccloskey)
Whiteboard: [MemShrink]
Attachment #8580936 - Flags: review?(wmccloskey) → review+
Maybe we should just convert the IPDL type to nsCString.
Attached patch patch v2Splinter Review
Attachment #8580936 - Attachment is obsolete: true
Attachment #8580939 - Flags: review?(wmccloskey)
Comment on attachment 8580939 [details] [diff] [review]
patch v2

Review of attachment 8580939 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8580939 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/7264dc608584
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Assignee: nobody → mrbkap
You need to log in before you can comment on or make changes to this bug.