From 71c804a05eb07fa21482ca298486ed70c63907ad Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 19 Oct 2018 16:10:45 +0100 Subject: pvs-studio: The 'store' variable is assigned values twice successively. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I532bf99935c2f4d3b58f666684013bc545791208 Reviewed-on: https://gerrit.libreoffice.org/62050 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- .../source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx index 5e6dfcb93a99..4ba5ad8a4417 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx @@ -735,14 +735,12 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificat } uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificateFromAscii( const OUString& asciiCertificate ) { - xmlChar* chCert ; - xmlSecSize certSize ; OString oscert = OUStringToOString( asciiCertificate , RTL_TEXTENCODING_ASCII_US ) ; - chCert = xmlStrndup( reinterpret_cast(oscert.getStr()), static_cast(oscert.getLength()) ) ; + xmlChar* chCert = xmlStrndup( reinterpret_cast(oscert.getStr()), static_cast(oscert.getLength()) ) ; - certSize = xmlSecBase64Decode( chCert, chCert, xmlStrlen( chCert ) ) ; + xmlSecSize certSize = xmlSecBase64Decode( chCert, chCert, xmlStrlen( chCert ) ) ; uno::Sequence< sal_Int8 > rawCert( certSize ) ; for( xmlSecSize i = 0 ; i < certSize ; i ++ ) @@ -757,9 +755,7 @@ uno::Reference< XCertificate > SecurityEnvironment_MSCryptImpl::createCertificat static HCERTSTORE getCertStoreForIntermediatCerts( const uno::Sequence< uno::Reference< css::security::XCertificate > >& seqCerts) { - HCERTSTORE store = nullptr; - store = CertOpenStore( - CERT_STORE_PROV_MEMORY, 0, NULL, 0, nullptr); + HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, 0, nullptr); if (store == nullptr) return nullptr; -- cgit v1.2.3