Closed Bug 388569 Opened 17 years ago Closed 14 years ago

Memory leaks when calling nsVariant::GetAsInterface

Categories

(Core :: Graphics: Canvas2D, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: matthew.gertner, Assigned: jdm)

Details

Attachments

(1 file, 1 obsolete file)

As far as I can see, nsVariant::GetAsInterface allocates memory to store the IID that it returns. So the caller should free this memory, but in no instance does it currently do so. An example is: http://mxr.mozilla.org/mozilla/source/content/canvas/src/nsCanvasRenderingContext2D.cpp#519.

I'll propose a patch.
Attached patch Patch (obsolete) — Splinter Review
Simple fix.  It looks like all other callers correctly free the result.
Assignee: matthew.gertner → josh
Attachment #442944 - Flags: review?(benjamin)
Comment on attachment 442944 [details] [diff] [review]
Patch

Use NS_Free instead of the deprecated nsMemory::Free.
Attachment #442944 - Flags: review?(benjamin) → review+
Attached patch PatchSplinter Review
Attachment #442944 - Attachment is obsolete: true
Keywords: checkin-needed
Component: XPCOM → Canvas: 2D
QA Contact: xpcom → canvas.2d
http://hg.mozilla.org/mozilla-central/rev/96a346a89fcf
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: