Closed Bug 660610 Opened 14 years ago Closed 14 years ago

JaegerCompartment::execAlloc_ double frees on OOM

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: paul.biggar, Unassigned)

References

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 file)

Attached patch FixSplinter Review
execAlloc_ is initialized in JaegerCompartment::Initialize, and is freed on the OOM error path. It is later unconditionally freed during JaegerCompartment::Finalize, leading to a segfault. This removes the firstee, assuming it will be freed later in Finalize. An alternative is to just add a NULL assignment to prevent the second delete.
Attachment #536051 - Flags: review?(nnethercote)
Comment on attachment 536051 [details] [diff] [review] Fix Review of attachment 536051 [details] [diff] [review]: ----------------------------------------------------------------- I prefer the alternative of adding a freeing in the OOM path and assigning NULL. r=me for that! Did your OOM tests find this?
Attachment #536051 - Flags: review?(nnethercote) → review+
Yeah, and a load of others hanging off 624094.
Whiteboard: [fixed-in-tracemonkey]
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: