summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-12 14:17:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 09:28:44 +0200
commit639df4d76d545ca23021f69a9d738a9a92c148cd (patch)
tree87b20ea1518f6a878102a367c211cb6f93c554fd /xmlsecurity/source
parent9dce6f74b1b43293b40217c1163c8d4285251e97 (diff)
use more std::make_unique
Change-Id: I7d85cbc9105c5e0c4a8d9a69c4ac9d6dfc07eabd Reviewed-on: https://gerrit.libreoffice.org/70663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx
index 4b6ef98cf905..8c58ffada322 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/sanextension_mscryptimpl.cxx
@@ -69,7 +69,7 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl:
DWORD size;
CryptDecodeObjectEx(X509_ASN_ENCODING, X509_ALTERNATE_NAME, reinterpret_cast<unsigned char*>(m_xExtnValue.getArray()), m_xExtnValue.getLength(), CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG, nullptr,&subjectName, &size);
- auto arrCertAltNameEntry = std::unique_ptr<CertAltNameEntry[]>(new CertAltNameEntry[subjectName->cAltEntry]);
+ auto arrCertAltNameEntry = std::make_unique<CertAltNameEntry[]>(subjectName->cAltEntry);
for (unsigned int i = 0; i < static_cast<unsigned int>(subjectName->cAltEntry); i++){
PCERT_ALT_NAME_ENTRY pEntry = &subjectName->rgAltEntry[i];
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index d44d093641c1..17c8eea1b71b 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -213,7 +213,7 @@ OUString SAL_CALL X509Certificate_MSCryptImpl::getIssuerName() {
// Here the cbIssuer count the last 0x00 , take care.
if( cchIssuer != 0 ) {
- auto issuer = std::unique_ptr<wchar_t[]>(new wchar_t[ cchIssuer ]);
+ auto issuer = std::make_unique<wchar_t[]>(cchIssuer);
cchIssuer = CertNameToStrW(
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING ,
@@ -251,7 +251,7 @@ OUString SAL_CALL X509Certificate_MSCryptImpl::getSubjectName()
if( cchSubject != 0 )
{
- auto subject = std::unique_ptr<wchar_t[]>(new wchar_t[ cchSubject ]);
+ auto subject = std::make_unique<wchar_t[]>(cchSubject);
cchSubject = CertNameToStrW(
X509_ASN_ENCODING | PKCS_7_ASN_ENCODING ,