diff options
| author | Clifford Jansen <cliffjansen@apache.org> | 2013-11-06 21:59:30 +0000 |
|---|---|---|
| committer | Clifford Jansen <cliffjansen@apache.org> | 2013-11-06 21:59:30 +0000 |
| commit | 5d8ae6ccc0969ab90693cc923a7def301e829044 (patch) | |
| tree | e0e23ce061fbd93ccd7a30dde285f544bcca8990 /cpp | |
| parent | c8e6fc7734ba9d854b1058bd2411cb30cba8dd99 (diff) | |
| download | qpid-python-5d8ae6ccc0969ab90693cc923a7def301e829044.tar.gz | |
QPID-3502: Windows SslConnector memory error from unititialized data
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1539474 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/qpid/client/windows/SslConnector.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cpp/src/qpid/client/windows/SslConnector.cpp b/cpp/src/qpid/client/windows/SslConnector.cpp index 1951401a89..a60ced9059 100644 --- a/cpp/src/qpid/client/windows/SslConnector.cpp +++ b/cpp/src/qpid/client/windows/SslConnector.cpp @@ -116,8 +116,9 @@ SslConnector::SslConnector(boost::shared_ptr<qpid::sys::Poller> p, 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_ptr<qpid::sys::Poller> p, 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) { |
