summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-28 10:33:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-29 08:51:48 +0200
commit1ffba0e356608fb6dbf568248e2a953b4d7fb5d6 (patch)
tree5da59640441292421f2137bc85ee7291daed137e /xmlsecurity
parentce9a41dc387966c74c1af92783a97565b5af3668 (diff)
loplugin:flatten check for throw in then clause
also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/saxhelper.cxx36
1 files changed, 17 insertions, 19 deletions
diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx
index 6fb61db139f6..10b2a0784acf 100644
--- a/xmlsecurity/source/xmlsec/saxhelper.cxx
+++ b/xmlsecurity/source/xmlsec/saxhelper.cxx
@@ -131,33 +131,31 @@ SAXHelper::SAXHelper( )
// and neither can we call xsltCleanupGlobals()
throw cssu::RuntimeException() ;
}
- else
- {
- xmlSAXVersion(m_pParserCtxt->sax, 1);
- if (m_pParserCtxt->inputTab != nullptr)
- {
- m_pParserCtxt->inputTab[0] = nullptr ;
- }
+ xmlSAXVersion(m_pParserCtxt->sax, 1);
- if( m_pParserCtxt->sax == nullptr )
- {
- xmlFreeParserCtxt( m_pParserCtxt ) ;
+ if (m_pParserCtxt->inputTab != nullptr)
+ {
+ m_pParserCtxt->inputTab[0] = nullptr ;
+ }
+
+ if( m_pParserCtxt->sax == nullptr )
+ {
+ xmlFreeParserCtxt( m_pParserCtxt ) ;
// see issue i74334, we cannot call xmlCleanupParser when libxml is still used
// in other parts of the office.
// xmlCleanupParser() ;
// and neither can we call xsltCleanupGlobals()
- m_pParserCtxt = nullptr ;
- throw cssu::RuntimeException() ;
- }
- else
- {
- m_pSaxHandler = m_pParserCtxt->sax ;
+ m_pParserCtxt = nullptr ;
+ throw cssu::RuntimeException() ;
+ }
+ else
+ {
+ m_pSaxHandler = m_pParserCtxt->sax ;
- //Adjust the context
- m_pParserCtxt->recovery = 1 ;
- }
+ //Adjust the context
+ m_pParserCtxt->recovery = 1 ;
}
}