File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -258,11 +258,21 @@ namespace Aws
258
258
{
259
259
if (mode == TlsMode::CLIENT)
260
260
{
261
- m_ctx.reset (aws_tls_client_ctx_new (allocator, &options.m_options ), aws_tls_ctx_destroy);
261
+ aws_tls_ctx *underlying_tls_ctx = aws_tls_client_ctx_new (allocator, &options.m_options );
262
+
263
+ if (underlying_tls_ctx != NULL )
264
+ {
265
+ m_ctx.reset (underlying_tls_ctx, aws_tls_ctx_destroy);
266
+ }
262
267
}
263
268
else
264
269
{
265
- m_ctx.reset (aws_tls_server_ctx_new (allocator, &options.m_options ), aws_tls_ctx_destroy);
270
+ aws_tls_ctx *underlying_tls_ctx = aws_tls_server_ctx_new (allocator, &options.m_options );
271
+
272
+ if (underlying_tls_ctx != NULL )
273
+ {
274
+ m_ctx.reset (underlying_tls_ctx, aws_tls_ctx_destroy);
275
+ }
266
276
}
267
277
268
278
if (!m_ctx)
You can’t perform that action at this time.
0 commit comments