// 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;
Created attachment 465244 [details] [diff] [review] patch
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
Created attachment 465264 [details] [diff] [review] bigger patch
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-
You need to log in before you can comment on or make changes to this bug.