qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cliffjan...@apache.org
Subject svn commit: r1539474 - /qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp
Date Wed, 06 Nov 2013 21:59:31 GMT
Author: cliffjansen
Date: Wed Nov  6 21:59:30 2013
New Revision: 1539474

URL: http://svn.apache.org/r1539474
Log:
QPID-3502: Windows SslConnector memory error from unititialized data

Modified:
    qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp?rev=1539474&r1=1539473&r2=1539474&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/windows/SslConnector.cpp Wed Nov  6 21:59:30 2013
@@ -116,8 +116,9 @@ SslConnector::SslConnector(boost::shared
                            framing::ProtocolVersion ver,
                            const ConnectionSettings& settings,
                            ConnectionImpl* cimpl)
-    : TCPConnector(p, ver, settings, cimpl), shim(0), poller(p)
+    : TCPConnector(p, ver, settings, cimpl), shim(0), poller(p), certStore(0), cert(0)
 {
+    SecInvalidateHandle(&credHandle);
     memset(&cred, 0, sizeof(cred));
     cred.dwVersion = SCHANNEL_CRED_VERSION;
 
@@ -149,10 +150,12 @@ SslConnector::SslConnector(boost::shared
 
 SslConnector::~SslConnector()
 {
+    if (SecIsValidHandle(&credHandle))
+        ::FreeCredentialsHandle(&credHandle);
     if (cert)
         ::CertFreeCertificateContext(cert);
-    ::CertCloseStore(certStore, CERT_CLOSE_STORE_FORCE_FLAG);
-    ::FreeCredentialsHandle(&credHandle);
+    if (certStore)
+        ::CertCloseStore(certStore, CERT_CLOSE_STORE_FORCE_FLAG);
 }
 
 void SslConnector::connect(const std::string& host, const std::string& port) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message