summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2022-02-08 19:00:36 +0000
committertb <>2022-02-08 19:00:36 +0000
commit16e7db8df15f497fb1e8f24d52fbaf6c7d03e227 (patch)
tree4b383ebcf310ac9e6495df6e303da8c2ce884190
parente56b2f642c292c251ffc94e9730d57c0bbe614d1 (diff)
downloadopenbsd-16e7db8df15f497fb1e8f24d52fbaf6c7d03e227.tar.gz
openbsd-16e7db8df15f497fb1e8f24d52fbaf6c7d03e227.tar.bz2
openbsd-16e7db8df15f497fb1e8f24d52fbaf6c7d03e227.zip
Plug a number of leaks reported by Ilya Shipitsin
-rw-r--r--src/regress/lib/libssl/tlsext/tlsexttest.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/regress/lib/libssl/tlsext/tlsexttest.c b/src/regress/lib/libssl/tlsext/tlsexttest.c
index 03ce7a95e9..c21a0e4b08 100644
--- a/src/regress/lib/libssl/tlsext/tlsexttest.c
+++ b/src/regress/lib/libssl/tlsext/tlsexttest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tlsexttest.c,v 1.59 2022/02/05 14:54:40 jsing Exp $ */ 1/* $OpenBSD: tlsexttest.c,v 1.60 2022/02/08 19:00:36 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -2249,7 +2249,7 @@ test_tlsext_sessionticket_server(void)
2249 SSL_CTX *ssl_ctx = NULL; 2249 SSL_CTX *ssl_ctx = NULL;
2250 SSL *ssl = NULL; 2250 SSL *ssl = NULL;
2251 int failure; 2251 int failure;
2252 uint8_t *data; 2252 uint8_t *data = NULL;
2253 size_t dlen; 2253 size_t dlen;
2254 CBB cbb; 2254 CBB cbb;
2255 2255
@@ -2318,6 +2318,7 @@ test_tlsext_sessionticket_server(void)
2318 CBB_cleanup(&cbb); 2318 CBB_cleanup(&cbb);
2319 SSL_CTX_free(ssl_ctx); 2319 SSL_CTX_free(ssl_ctx);
2320 SSL_free(ssl); 2320 SSL_free(ssl);
2321 free(data);
2321 2322
2322 return (failure); 2323 return (failure);
2323} 2324}
@@ -2800,6 +2801,8 @@ test_tlsext_clienthello_build(void)
2800 goto err; 2801 goto err;
2801 } 2802 }
2802 2803
2804 free(data);
2805 data = NULL;
2803 CBB_cleanup(&cbb); 2806 CBB_cleanup(&cbb);
2804 CBB_init(&cbb, 0); 2807 CBB_init(&cbb, 0);
2805 2808
@@ -2917,6 +2920,8 @@ test_tlsext_serverhello_build(void)
2917 } 2920 }
2918 2921
2919 CBB_cleanup(&cbb); 2922 CBB_cleanup(&cbb);
2923 free(data);
2924 data = NULL;
2920 CBB_init(&cbb, 0); 2925 CBB_init(&cbb, 0);
2921 2926
2922 /* Turn a few things on so we get extensions... */ 2927 /* Turn a few things on so we get extensions... */
@@ -3326,6 +3331,8 @@ test_tlsext_keyshare_server(void)
3326 goto done; 3331 goto done;
3327 } 3332 }
3328 3333
3334 tls_key_share_free(ssl->s3->hs.key_share);
3335
3329 if ((ssl->s3->hs.key_share = 3336 if ((ssl->s3->hs.key_share =
3330 tls_key_share_new_nid(NID_X25519)) == NULL) { 3337 tls_key_share_new_nid(NID_X25519)) == NULL) {
3331 FAIL("failed to create key share"); 3338 FAIL("failed to create key share");