Closed Bug 76596 Opened 24 years ago Closed 23 years ago

Manually closing a JAR input stream crashes mozilla

Categories

(SeaMonkey :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: markh, Assigned: dveditz)

Details

Attachments

(1 file)

If js code explicitly closes a JAR input stream, the stream crashes as it destructs. The "Close()" method of the stream is a public method, and is also called by the object destructor. However, the close method does not guard against being called twice, and therefore attempts to free memory twice. Attaching a patch that fixes the crash by resetting the freed pointer to null.
Good catch, it's a bad pattern we've seen in other (mailnews consumed) stream impls. Who should review the patch? I can give it r/sr=brendan@mozilla.org. Should it get into 0.9? Reassigning based on cvs annotate output. /be
Assignee: asa → dveditz
Deleting a null pointers is a no-op, a simplier patch is just the null assignment. r=dougt.
Status: NEW → ASSIGNED
The code seems to have already changed in this area.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: