summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-01-19 13:24:19 +0900
committerJulien Nabet <serval2412@yahoo.fr>2017-01-19 10:46:07 +0000
commit9aeccd9ac7b71bfa225e4a2c4dd6692a4659da71 (patch)
tree05b71969af770d4f3ecf670b262a4b0044a7c4b0
parent716db7dd4a41235007ec0f8e1d3bdb44a83f0bd8 (diff)
vcl: Fix a small chance of memleaks
Change-Id: I4fe286486f9cad57c4220d10367442a51f077f00 Reviewed-on: https://gerrit.libreoffice.org/33294 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index e79752a46c1e..a4f2fe0f1cb3 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6794,6 +6794,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
if (!aCertHashContext.get())
{
SAL_WARN("vcl.pdfwriter", "HASH_Create() failed");
+ free(pass);
return false;
}
HASH_Begin(aCertHashContext.get());
@@ -6818,6 +6819,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
if (!pEncodedCertificate)
{
SAL_WARN("vcl.pdfwriter", "SEC_ASN1EncodeItem() failed");
+ free(pass);
return false;
}
@@ -6842,6 +6844,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
if (my_SEC_StringToOID(&aOidData.oid, "1.2.840.113549.1.9.16.2.47", 0) != SECSuccess)
{
SAL_WARN("vcl.pdfwriter", "my_SEC_StringToOID() failed");
+ free(pass);
return false;
}
aOidData.offset = SEC_OID_UNKNOWN;
@@ -6855,6 +6858,7 @@ bool PDFWriter::Sign(PDFSignContext& rContext)
if (my_NSS_CMSSignerInfo_AddAuthAttr(cms_signer, &aAttribute) != SECSuccess)
{
SAL_WARN("vcl.pdfwriter", "my_NSS_CMSSignerInfo_AddAuthAttr() failed");
+ free(pass);
return false;
}