From 3cc0bb37e3543052f336abe1d3349ff095f72ae2 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 5 Nov 2018 17:21:34 -0800 Subject: fixes #456 TLS configuration object hold fixes #776 Configuration of mbedTLS should warn about license --- src/supplemental/http/http_client.c | 1 + src/supplemental/http/http_server.c | 1 + 2 files changed, 2 insertions(+) (limited to 'src/supplemental/http') diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c index a8260705..c70b7a63 100644 --- a/src/supplemental/http/http_client.c +++ b/src/supplemental/http/http_client.c @@ -223,6 +223,7 @@ nni_http_client_get_tls(nni_http_client *c, struct nng_tls_config **tlsp) nni_mtx_unlock(&c->mtx); return (NNG_EINVAL); } + nni_tls_config_hold(c->tls); *tlsp = c->tls; nni_mtx_unlock(&c->mtx); return (0); diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index cdbfe3e6..b7ca9f7e 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -1799,6 +1799,7 @@ nni_http_server_get_tls(nni_http_server *s, nng_tls_config **tp) nni_mtx_unlock(&s->mtx); return (NNG_EINVAL); } + nni_tls_config_hold(s->tls); *tp = s->tls; nni_mtx_unlock(&s->mtx); return (0); -- cgit v1.2.3-70-g09d2