From bb675266247e7ae56385c48a7e2c5ab39265a22b Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 8 Feb 2022 19:00:36 +0000 Subject: [PATCH] Plug a number of leaks reported by Ilya Shipitsin --- regress/lib/libssl/tlsext/tlsexttest.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/regress/lib/libssl/tlsext/tlsexttest.c b/regress/lib/libssl/tlsext/tlsexttest.c index 03ce7a95e94..c21a0e4b083 100644 --- a/regress/lib/libssl/tlsext/tlsexttest.c +++ b/regress/lib/libssl/tlsext/tlsexttest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlsexttest.c,v 1.59 2022/02/05 14:54:40 jsing Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.60 2022/02/08 19:00:36 tb Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -2249,7 +2249,7 @@ test_tlsext_sessionticket_server(void) SSL_CTX *ssl_ctx = NULL; SSL *ssl = NULL; int failure; - uint8_t *data; + uint8_t *data = NULL; size_t dlen; CBB cbb; @@ -2318,6 +2318,7 @@ test_tlsext_sessionticket_server(void) CBB_cleanup(&cbb); SSL_CTX_free(ssl_ctx); SSL_free(ssl); + free(data); return (failure); } @@ -2800,6 +2801,8 @@ test_tlsext_clienthello_build(void) goto err; } + free(data); + data = NULL; CBB_cleanup(&cbb); CBB_init(&cbb, 0); @@ -2917,6 +2920,8 @@ test_tlsext_serverhello_build(void) } CBB_cleanup(&cbb); + free(data); + data = NULL; CBB_init(&cbb, 0); /* Turn a few things on so we get extensions... */ @@ -3326,6 +3331,8 @@ test_tlsext_keyshare_server(void) goto done; } + tls_key_share_free(ssl->s3->hs.key_share); + if ((ssl->s3->hs.key_share = tls_key_share_new_nid(NID_X25519)) == NULL) { FAIL("failed to create key share"); -- 2.20.1