summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/SecureTransportEngine.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-01-13 09:39:17 +0100
committerJose <jose@zeroc.com>2017-01-13 09:39:17 +0100
commitfd6e9a9f4607d8bbec226deebbd99e036c1873d9 (patch)
tree0f9aab46d22a22dddc1338cd2d8a6f4eca0f5b0b /cpp/src/IceSSL/SecureTransportEngine.cpp
parentAdded shutdown of the simulator (diff)
downloadice-fd6e9a9f4607d8bbec226deebbd99e036c1873d9.tar.bz2
ice-fd6e9a9f4607d8bbec226deebbd99e036c1873d9.tar.xz
ice-fd6e9a9f4607d8bbec226deebbd99e036c1873d9.zip
Fixed (ICE-7480) - Use UniqueRef to manage CoreFoundation types.
Diffstat (limited to 'cpp/src/IceSSL/SecureTransportEngine.cpp')
-rw-r--r--cpp/src/IceSSL/SecureTransportEngine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/IceSSL/SecureTransportEngine.cpp b/cpp/src/IceSSL/SecureTransportEngine.cpp
index 6dd7e82b233..cc7e80503d0 100644
--- a/cpp/src/IceSSL/SecureTransportEngine.cpp
+++ b/cpp/src/IceSSL/SecureTransportEngine.cpp
@@ -31,6 +31,7 @@
using namespace std;
using namespace IceUtil;
using namespace Ice;
+using namespace IceInternal;
using namespace IceSSL;
namespace
@@ -1192,15 +1193,14 @@ IceSSL::SecureTransportEngine::parseCiphers(const string& ciphers)
//
// Context used to get the cipher list
//
- SSLContextRef ctx = SSLCreateContext(kCFAllocatorDefault, kSSLServerSide, kSSLStreamType);
+ UniqueRef<SSLContextRef> ctx(SSLCreateContext(kCFAllocatorDefault, kSSLServerSide, kSSLStreamType));
size_t numSupportedCiphers = 0;
- SSLGetNumberSupportedCiphers(ctx, &numSupportedCiphers);
+ SSLGetNumberSupportedCiphers(ctx.get(), &numSupportedCiphers);
vector<SSLCipherSuite> supported;
supported.resize(numSupportedCiphers);
- OSStatus err = SSLGetSupportedCiphers(ctx, &supported[0], &numSupportedCiphers);
- CFRelease(ctx);
+ OSStatus err = SSLGetSupportedCiphers(ctx.get(), &supported[0], &numSupportedCiphers);
if(err)
{
throw PluginInitializationException(__FILE__, __LINE__,