From 7d324d6b4a253e59f811b823131fa480dca49d94 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 6 May 2017 20:59:28 +0000 Subject: 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@ --- src/lib/libtls/tls_server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/libtls/tls_server.c') 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 @@ -/* $OpenBSD: tls_server.c,v 1.36 2017/04/10 17:11:13 jsing Exp $ */ +/* $OpenBSD: tls_server.c,v 1.37 2017/05/06 20:59:28 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -48,6 +48,8 @@ tls_server_conn(struct tls *ctx) return (NULL); conn_ctx->flags |= TLS_SERVER_CONN; + + ctx->config->refcount++; conn_ctx->config = ctx->config; return (conn_ctx); -- cgit v1.2.3-55-g6feb