Closed Bug 441454 Opened 16 years ago Closed 16 years ago

Potential leak in gfxImageSurface for invalid images

Categories

(Core :: Graphics, defect)

1.9.0 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

(Keywords: memory-leak)

Attachments

(1 file)

Potential leak in gfxImageSurface for invalid images:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/gfx/thebes/src/gfxImageSurface.cpp&rev=1.14&root=/cvsroot&mark=54,61,86-87,89-90#44

If the malloc succeeds on line 54 and if the surface becomes invalid
for some reason, then it looks like we will fail to free the allocated block.
Attached patch Patch rev. 1Splinter Review
Make sure mOwnsData is initialized, even if we return early.
Call free() based on mOwnsData only.
Attachment #326431 - Flags: superreview?(vladimir)
Attachment #326431 - Flags: review?(vladimir)
Attachment #326431 - Flags: superreview?(vladimir)
Attachment #326431 - Flags: superreview+
Attachment #326431 - Flags: review?(vladimir)
Attachment #326431 - Flags: review+
http://hg.mozilla.org/mozilla-central/index.cgi/rev/88741ae85b0b

-> FIXED
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: