coverity#1343637 Double free
and coverity#1343638 Double free coverity#1343639 Double free coverity#1343640 Double free coverity#1343641 Double free Change-Id: I8ce42f03d40fe514f73b3a7eabdb4f323b2239e6
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <tools/ref.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <cppuhelper/implbase1.hxx>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
|
||||
class SvXMLNamespaceMap;
|
||||
class SvXMLImport;
|
||||
@@ -42,11 +43,10 @@ class XMLOFF_DLLPUBLIC SvXMLImportContext : public SvRefBase,
|
||||
sal_uInt16 mnPrefix;
|
||||
OUString maLocalName;
|
||||
|
||||
SvXMLNamespaceMap *mpRewindMap;
|
||||
std::unique_ptr<SvXMLNamespaceMap> mxRewindMap;
|
||||
|
||||
SAL_DLLPRIVATE SvXMLNamespaceMap *TakeRewindMap()
|
||||
{ auto p = mpRewindMap; mpRewindMap = nullptr; return p; }
|
||||
SAL_DLLPRIVATE void PutRewindMap( SvXMLNamespaceMap *p ) { mpRewindMap = p; }
|
||||
SAL_DLLPRIVATE SvXMLNamespaceMap *TakeRewindMap() { return mxRewindMap.release(); }
|
||||
SAL_DLLPRIVATE void PutRewindMap( SvXMLNamespaceMap *p ) { mxRewindMap.reset(p); }
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -23,31 +23,27 @@
|
||||
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
||||
#include <com/sun/star/xml/sax/XAttributeList.hpp>
|
||||
#include <com/sun/star/xml/sax/XLocator.hpp>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
#include <xmloff/xmlimp.hxx>
|
||||
#include <xmloff/xmlictxt.hxx>
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
|
||||
SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
|
||||
const OUString& rLName ) :
|
||||
mrImport( rImp ),
|
||||
mnPrefix( nPrfx ),
|
||||
maLocalName( rLName ),
|
||||
mpRewindMap( nullptr )
|
||||
const OUString& rLName )
|
||||
: mrImport(rImp)
|
||||
, mnPrefix(nPrfx)
|
||||
, maLocalName(rLName)
|
||||
{
|
||||
}
|
||||
|
||||
SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp ) :
|
||||
mrImport( rImp ),
|
||||
mnPrefix ( 0 ),
|
||||
mpRewindMap( nullptr )
|
||||
SvXMLImportContext::SvXMLImportContext( SvXMLImport& rImp )
|
||||
: mrImport(rImp)
|
||||
, mnPrefix(0)
|
||||
{
|
||||
}
|
||||
|
||||
SvXMLImportContext::~SvXMLImportContext()
|
||||
{
|
||||
delete mpRewindMap;
|
||||
}
|
||||
|
||||
SvXMLImportContext *SvXMLImportContext::CreateChildContext( sal_uInt16 nPrefix,
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
|
||||
#include <com/sun/star/xml/sax/XAttributeList.hpp>
|
||||
#include <osl/diagnose.h>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
|
||||
#include "TransformerBase.hxx"
|
||||
|
||||
@@ -47,16 +46,14 @@ bool XMLTransformerContext::HasNamespace( sal_uInt16 nPrefix ) const
|
||||
}
|
||||
|
||||
XMLTransformerContext::XMLTransformerContext( XMLTransformerBase& rImp,
|
||||
const OUString& rQName ) :
|
||||
m_rTransformer( rImp ),
|
||||
m_aQName( rQName ),
|
||||
m_pRewindMap( nullptr )
|
||||
const OUString& rQName )
|
||||
: m_rTransformer(rImp)
|
||||
, m_aQName(rQName)
|
||||
{
|
||||
}
|
||||
|
||||
XMLTransformerContext::~XMLTransformerContext()
|
||||
{
|
||||
delete m_pRewindMap;
|
||||
}
|
||||
|
||||
rtl::Reference<XMLTransformerContext> XMLTransformerContext::CreateChildContext( sal_uInt16 nPrefix,
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include <salhelper/simplereferenceobject.hxx>
|
||||
#include <rtl/ref.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <xmloff/nmspmap.hxx>
|
||||
#include <xmloff/xmltoken.hxx>
|
||||
|
||||
class SvXMLNamespaceMap;
|
||||
@@ -37,11 +38,10 @@ class XMLTransformerContext : public ::salhelper::SimpleReferenceObject
|
||||
|
||||
OUString m_aQName;
|
||||
|
||||
SvXMLNamespaceMap *m_pRewindMap;
|
||||
std::unique_ptr<SvXMLNamespaceMap> m_xRewindMap;
|
||||
|
||||
SvXMLNamespaceMap *TakeRewindMap()
|
||||
{ auto p = m_pRewindMap; m_pRewindMap = nullptr; return p; }
|
||||
void PutRewindMap( SvXMLNamespaceMap *p ) { m_pRewindMap = p; }
|
||||
SvXMLNamespaceMap *TakeRewindMap() { return m_xRewindMap.release(); }
|
||||
void PutRewindMap( SvXMLNamespaceMap *p ) { m_xRewindMap.reset(p); }
|
||||
|
||||
protected:
|
||||
|
||||
|
Reference in New Issue
Block a user