Open Bug 586654 Opened 14 years ago Updated 2 years ago

Change XULContentSinkImpl to fail early / avoid leaking element

Categories

(Core :: XUL, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: timeless, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

// Create the element
     nsXULPrototypeElement* element;
     rv = CreateElement(aNodeInfo, &element);
... 
     // Set the correct script-type for the element.
     rv = SetElementScriptType(element, aAttributes, aAttrLen);
leak element:
     if (NS_FAILED(rv)) return rv;
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #465244 - Flags: review?(neil)
actually, let's do it a bit more consistently for the file...
Summary: XULContentSinkImpl::OpenRoot leaks element when SetElementScriptType fails → Change XULContentSinkImpl to fail early / avoid leaking element
Attached patch bigger patchSplinter Review
Attachment #465244 - Attachment is obsolete: true
Attachment #465264 - Flags: review?(neil)
Attachment #465244 - Flags: review?(neil)
Comment on attachment 465264 [details] [diff] [review]
bigger patch

I'm not too keen on either of the variants of failure propagation used here, so I'd rather you didn't change the style. (While there is one instance of /(NS_FAILED(rv))$/ in the file I guess that seems to be against file style.)

Unfortunately this crashed when I tried it.
Attachment #465264 - Flags: review?(neil) → review-

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: timeless → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: