From: Steve Brokenshire <sbrokenshire@xestia.co.uk>
Date: Mon, 16 May 2016 20:20:29 +0000 (+0100)
Subject: Replaced CERT_CONTEXT with PCCERT_CONTEXT for the frmMain::UpdateSSLAccountStatus... 
X-Git-Tag: release-0.13~21
X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=5adbbedaa38b2853d751f2e4dbf43521296447f6;p=xestiaab%2F.git

Replaced CERT_CONTEXT with PCCERT_CONTEXT for the frmMain::UpdateSSLAccountStatus function.
---

diff --git a/source/frmMain.cpp b/source/frmMain.cpp
index 9685929..026b9e9 100644
--- a/source/frmMain.cpp
+++ b/source/frmMain.cpp
@@ -2664,10 +2664,16 @@ void frmMain::ResumeAllTimers(){
 
 #elif defined(__WIN32__)
 
-void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, CERT_CONTEXT CertificateContext){
+void frmMain::UpdateSSLAccountStatus(int AccountID, int SSLStatus, PCCERT_CONTEXT CertificateContext){
 
 	// Delete existing data.
 
+	std::map<int, PCCERT_CONTEXT>::iterator CertificateIter = AccountCertificateData.find(AccountID);
+
+	if (CertificateIter != AccountCertificateData.end()){
+		CertFreeCertificateContext(CertificateIter->second);
+	}
+
 	AccountCertificateData.erase(AccountID);
 	AccountSSLResult.erase(AccountID);
 
diff --git a/source/frmMain.h b/source/frmMain.h
index 1c9cddc..8a5ac21 100644
--- a/source/frmMain.h
+++ b/source/frmMain.h
@@ -130,7 +130,7 @@ class frmMain : public frmMainADT
 #if defined(__APPLE__)
 		std::map<int, SecTrustRef> AccountTrustData;
 #elif defined(__WIN32__)
-		std::map<int, CERT_CONTEXT> AccountCertificateData;
+		std::map<int, PCCERT_CONTEXT> AccountCertificateData;
 #else
 		std::map<int, SSLCertCollection> AccountSSLData;
 #endif
@@ -279,7 +279,7 @@ class frmMain : public frmMainADT
 #if defined(__APPLE__)
 		void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SecTrustRef SecurityTrustObject);
 #elif defined(__WIN32__)
-		void UpdateSSLAccountStatus(int AccountID, int SSLStatus, CERT_CONTEXT CertificateContext);
+		void UpdateSSLAccountStatus(int AccountID, int SSLStatus, PCCERT_CONTEXT CertificateContext);
 #else
 		void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc);
 #endif