From: Steve Brokenshire Date: Mon, 16 May 2016 21:05:54 +0000 (+0100) Subject: Free the previous SSL certificate context before getting a new one. X-Git-Tag: release-0.13~13 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=33d42b86e8f3b66c7af4f8bfceeee4d4987a59c5 Free the previous SSL certificate context before getting a new one. --- 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