diff options
author | jsing <> | 2017-05-06 20:59:28 +0000 |
---|---|---|
committer | jsing <> | 2017-05-06 20:59:28 +0000 |
commit | 7d324d6b4a253e59f811b823131fa480dca49d94 (patch) | |
tree | 657a8c245abd0d5e2045521716d7977e1dfe887f /src/lib/libtls/tls_server.c | |
parent | e09c50ecb0edf1f7c4f6a7b1dee1285ccbf08d5a (diff) | |
download | openbsd-7d324d6b4a253e59f811b823131fa480dca49d94.tar.gz openbsd-7d324d6b4a253e59f811b823131fa480dca49d94.tar.bz2 openbsd-7d324d6b4a253e59f811b823131fa480dca49d94.zip |
Perform reference counting for tls_config. This allows tls_config_free() to
be called as soon as it has been passed to the final tls_configure() call,
simplifying lifetime tracking for the application.
Requested some time ago by tedu@.
ok beck@
Diffstat (limited to 'src/lib/libtls/tls_server.c')
-rw-r--r-- | src/lib/libtls/tls_server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_server.c b/src/lib/libtls/tls_server.c index 39c6ca79e9..abac01ca5c 100644 --- a/src/lib/libtls/tls_server.c +++ b/src/lib/libtls/tls_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_server.c,v 1.36 2017/04/10 17:11:13 jsing Exp $ */ | 1 | /* $OpenBSD: tls_server.c,v 1.37 2017/05/06 20:59:28 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -48,6 +48,8 @@ tls_server_conn(struct tls *ctx) | |||
48 | return (NULL); | 48 | return (NULL); |
49 | 49 | ||
50 | conn_ctx->flags |= TLS_SERVER_CONN; | 50 | conn_ctx->flags |= TLS_SERVER_CONN; |
51 | |||
52 | ctx->config->refcount++; | ||
51 | conn_ctx->config = ctx->config; | 53 | conn_ctx->config = ctx->config; |
52 | 54 | ||
53 | return (conn_ctx); | 55 | return (conn_ctx); |