diff options
author | Michael Stahl <mst@openoffice.org> | 2011-01-19 20:27:15 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-01-19 20:27:15 +0100 |
commit | e2108d556163e7ca1b5bc8ebaa46d86f77f3fbee (patch) | |
tree | f30128411c298524fd839bc1ec6de3848849cb4e /unoxml/source/dom/attr.cxx | |
parent | 8f5bbf5b121339f21c3859b8476a994c4cfc841a (diff) |
xmlfix3: #i113663#: unoxml: fix leaks caused by CNode::get returning CNode*:
CNode::getCNode now returns rtl::Reference<CNode>, preventing leaks.
Diffstat (limited to 'unoxml/source/dom/attr.cxx')
-rw-r--r-- | unoxml/source/dom/attr.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx index a1773a7db99f..1bbd5234e6a0 100644 --- a/unoxml/source/dom/attr.cxx +++ b/unoxml/source/dom/attr.cxx @@ -76,12 +76,14 @@ namespace DOM Reference< XElement > SAL_CALL CAttr::getOwnerElement() throw (RuntimeException) { - Reference< XElement > aElement; - if (m_aAttrPtr != NULL && m_aAttrPtr->parent != NULL) + if ((m_aAttrPtr == 0) || (m_aAttrPtr->parent == 0)) { - aElement = Reference< XElement >(static_cast< CElement* >(CNode::get(m_aAttrPtr->parent))); + return 0; } - return aElement; + Reference< XElement > const xRet( + static_cast< XNode* >(CNode::getCNode(m_aAttrPtr->parent).get()), + UNO_QUERY_THROW); + return xRet; } /** |