diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 1606502416d..04e0bbbc11b 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -1219,6 +1219,10 @@ nsGenericElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes) NS_ENSURE_ARG_POINTER(aAttributes); nsDOMSlots *slots = GetDOMSlots(); + if (!slots) { + return NS_ERROR_OUT_OF_MEMORY; + } + if (!slots->mAttributeMap) { slots->mAttributeMap = new nsDOMAttributeMap(this); if (!slots->mAttributeMap) { @@ -1236,6 +1240,10 @@ nsGenericElement::GetChildNodes(nsIDOMNodeList** aChildNodes) { nsDOMSlots *slots = GetDOMSlots(); + if (!slots) { + return NS_ERROR_OUT_OF_MEMORY; + } + if (!slots->mChildNodes) { slots->mChildNodes = new nsChildContentList(this); if (!slots->mChildNodes) {