Closed Bug 1330614 Opened 3 years ago Closed 3 years ago

[Static Analysis][Resource Leak] In function FillRectWithMask

Categories

(Core :: Graphics: Layers, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1398558)

Attachments

(1 file)

The Static Analysis tool Coverity detected that a memory leak would happen in the following context:

>>    size_t size = mr->RecordingSize();
>>    char* buffer = new char[size];
>>    mr->CopyRecording(buffer, size);
>>    std::istringstream recording(std::string(buffer, size));
>>
>>    translator->TranslateRecording(recording);
>>
>>    aDT->SetTransform(oldTransform);
>>    aDT->PopClip();
>>    return;

Since buffer is not cached it should be removed.
Comment on attachment 8826158 [details]
Bug 1330614 - avoid memory leak in FillRectWithMask.

https://reviewboard.mozilla.org/r/104176/#review104930
Attachment #8826158 - Flags: review?(jmuizelaar) → review+
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd0c259fde48
avoid memory leak in FillRectWithMask. r=jrmuizel
https://hg.mozilla.org/mozilla-central/rev/cd0c259fde48
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.