Closed Bug 72019 Opened 25 years ago Closed 25 years ago

[MLK] Massive memory leak of buffers in ns4xPluginStreamListener::OnDataAvailable()

Categories

(Core Graveyard :: Plug-ins, defect)

PowerPC
Mac System 9.x
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.8.1

People

(Reporter: beard, Assigned: serhunt)

Details

(Keywords: memory-leak, Whiteboard: have patch ready for 0.8.1)

Attachments

(1 file)

Every buffer that gets allocated in ns4xPluginStreamListener::OnDataAvailable() leaks. When testing the cache with the Quicktime plugin on the Mac, this generated a HUGE memory leak as it displayed a Quicktime movie. I have a patch, and this should probably go in to Mozilla 0.8.1, IMHO.
Keywords: mlk
Target Milestone: --- → mozilla0.8.1
Some comments on the patch: * maybe you should switch from PR_Free() to nsCRT::free() and PR_Malloc to nsCRT::malloc()? * please avoid goto's if possible otherwise the patch looks good to me.
The goto is legitimate, to implement a common exit point for early returns. If we had a generic class for managing dynamically allocated buffers, this could be used and early returns wouldn't require a goto. I was interested in creating a minimal patch.
Personally, I'd use nsMemory instead of nsCRT. What it comes down to is we have too many ways to manipulate memory (IMO). And yes, breaks could be used instead of gotos, but the final code will be essentially the same. The patch is solid and a distinct improvement over the rather severe leakage currently happening. r=bnesse.
lets do it as soon as leaf is ready for checkin's
Whiteboard: have patch ready for 0.8.1
a=av
nice! sr=waterson
let's get this checked in a=asa (on behalf of drivers)
So, who's checking this in to the trunk? Am I?
I've done this. Marking fixed.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
verif(rubberstamp)
Status: RESOLVED → VERIFIED
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: