From 33d42b86e8f3b66c7af4f8bfceeee4d4987a59c5 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 16 May 2016 22:05:54 +0100 Subject: [PATCH] Free the previous SSL certificate context before getting a new one. --- source/carddav/carddav.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/carddav/carddav.cpp b/source/carddav/carddav.cpp index 5276cb7..7e73c5f 100644 --- a/source/carddav/carddav.cpp +++ b/source/carddav/carddav.cpp @@ -60,9 +60,14 @@ size_t CardDAV::WritebackFunc(char *ptr, size_t size, size_t nmemb, wxString *st std::string CertName; if (TLSInfo->internals != nullptr && TLSCode == CURLE_OK){ + + // Free the previous certificate data. + + CertFreeCertificateContext(CertificateData); + PCtxtHandle SSLHandle = (PCtxtHandle)TLSInfo->internals; SECURITY_STATUS GetData = QueryContextAttributes(SSLHandle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &CertificateData); - //QueryContextAttributesA(TLSInfo->internals, SECPKG_); + } #endif -- 2.39.2