Closed Bug 617971 Opened 9 years ago Closed 9 years ago

nsStyleAnimation::ExtractComputedValue leaks pair when StyleCoordToCSSValue fails

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla2.0b8
Tracking Status
blocking2.0 --- final+

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, memory-leak)

Attachments

(1 file, 2 obsolete files)

2146 nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
2159   switch (animType) {
2160     case eStyleAnimType_Custom:
2161       switch (aProperty) {
2256         case eCSSProperty__moz_transform_origin: {
2259           nsCSSValuePair *pair = new nsCSSValuePair;
2260           if (!pair ||
2261               !StyleCoordToCSSValue(styleDisplay->mTransformOrigin[0],
2262                                     pair->mXValue) ||
2263               !StyleCoordToCSSValue(styleDisplay->mTransformOrigin[1],
2264                                     pair->mYValue)) {
2265             return PR_FALSE;
2266           }

2574       nsCSSValuePair *pair = new nsCSSValuePair;
2575       if (!pair ||
2576           !StyleCoordToCSSValue(horiz, pair->mXValue) ||
2577           !StyleCoordToCSSValue(vert, pair->mYValue)) {
2578         return PR_FALSE;
blocking2.0: --- → ?
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #496602 - Flags: review?(bzbarsky)
Comment on attachment 496602 [details] [diff] [review]
patch

r=me
Attachment #496602 - Flags: review?(bzbarsky)
Attachment #496602 - Flags: review+
Attachment #496602 - Flags: approval2.0+
I think elsewhere in the same file we use nsAutoPtr<> to handle this deletion -- should we do that here as well, for consistency & future-proofing against other newly-added early-return cases?
That'd be fine too.
Attached patch nsAutoPtr/forgetSplinter Review
Attachment #496602 - Attachment is obsolete: true
Attachment #496622 - Flags: review+
Keywords: checkin-needed
Attachment #496621 - Flags: review?(bzbarsky)
Comment on attachment 496621 [details] [diff] [review]
Remove StyleCoordToCSSValue's useless return value

please use another bug for other stuff.
Attachment #496621 - Attachment is obsolete: true
Attachment #496621 - Flags: review?(bzbarsky)
Landed:
http://hg.mozilla.org/mozilla-central/rev/5677a819829a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
You need to log in before you can comment on or make changes to this bug.