summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_mac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qsslsocket_mac.cpp')
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 0a9588deea..4216e2a16a 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -1223,8 +1223,10 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
QCFType<CFMutableArrayRef> certArray = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
for (const QSslCertificate &cert : qAsConst(configuration.caCertificates)) {
QCFType<CFDataRef> certData = cert.d->derData.toCFData();
- QCFType<SecCertificateRef> certRef = SecCertificateCreateWithData(NULL, certData);
- CFArrayAppendValue(certArray, certRef);
+ if (QCFType<SecCertificateRef> secRef = SecCertificateCreateWithData(NULL, certData))
+ CFArrayAppendValue(certArray, secRef);
+ else
+ qCWarning(lcSsl, "Failed to create SecCertificate from QSslCertificate");
}
SecTrustSetAnchorCertificates(trust, certArray);