mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 67900. Unitialized bare pointer with nsCOMPtr, avoiding crash if GetElementResource() fails, and fixing a leak to boot. r=scottip,rjesup; sr=alecf; a=blizzard
This commit is contained in:
parent
31b6ee0ac8
commit
a964382ebd
@ -1800,8 +1800,8 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, sortPtr sortInfo, PR
|
||||
{
|
||||
--currentElement;
|
||||
|
||||
nsIRDFResource *resource;
|
||||
gXULUtils->GetElementResource(child, &resource);
|
||||
nsCOMPtr<nsIRDFResource> resource;
|
||||
gXULUtils->GetElementResource(child, getter_AddRefs(resource));
|
||||
contentSortInfo *contentInfo = CreateContentSortInfo(child, resource);
|
||||
if(contentInfo)
|
||||
contentSortInfoArray[currentElement] = contentInfo;
|
||||
|
@ -1800,8 +1800,8 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, sortPtr sortInfo, PR
|
||||
{
|
||||
--currentElement;
|
||||
|
||||
nsIRDFResource *resource;
|
||||
gXULUtils->GetElementResource(child, &resource);
|
||||
nsCOMPtr<nsIRDFResource> resource;
|
||||
gXULUtils->GetElementResource(child, getter_AddRefs(resource));
|
||||
contentSortInfo *contentInfo = CreateContentSortInfo(child, resource);
|
||||
if(contentInfo)
|
||||
contentSortInfoArray[currentElement] = contentInfo;
|
||||
|
Loading…
x
Reference in New Issue
Block a user