summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-05 15:02:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-05 21:00:53 +0100
commit3635f65a65da6198d770d5148b68a81c271b9169 (patch)
treeb604a297238aa4a9082421ccbb64d41f6c442249 /xmlsecurity
parent5336952fc7fa6f8e1ae9652f59c87e29693694d4 (diff)
fix a potential mem leak
Change-Id: Ibc5f978b0db17e9e3fc633e843f476052570edfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142332 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 3aa9cab78a51..990ea86a9bbb 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -477,7 +477,10 @@ Reference< XCertificate > SecurityEnvironment_NssImpl::createCertificateFromAsci
xmlSecSize certSize;
int nRet = xmlSecBase64Decode_ex( chCert, reinterpret_cast<xmlSecByte*>(chCert), xmlStrlen( chCert ), &certSize ) ;
if (nRet < 0 || certSize == 0)
+ {
+ xmlFree(chCert);
return nullptr;
+ }
Sequence< sal_Int8 > rawCert(comphelper::arrayToSequence<sal_Int8>(chCert, certSize)) ;