Skip to content

Commit e64ee4f

Browse files
author
tb
committed
Plug a number of leaks reported by Ilya Shipitsin
1 parent b0abe48 commit e64ee4f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/regress/lib/libssl/tlsext/tlsexttest.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: tlsexttest.c,v 1.58 2022/01/11 18:29:10 jsing Exp $ */
1+
/* $OpenBSD: tlsexttest.c,v 1.59 2022/02/05 14:54:40 jsing Exp $ */
22
/*
33
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
44
* Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -2249,7 +2249,7 @@ test_tlsext_sessionticket_server(void)
22492249
SSL_CTX *ssl_ctx = NULL;
22502250
SSL *ssl = NULL;
22512251
int failure;
2252-
uint8_t *data;
2252+
uint8_t *data = NULL;
22532253
size_t dlen;
22542254
CBB cbb;
22552255

@@ -2318,6 +2318,7 @@ test_tlsext_sessionticket_server(void)
23182318
CBB_cleanup(&cbb);
23192319
SSL_CTX_free(ssl_ctx);
23202320
SSL_free(ssl);
2321+
free(data);
23212322

23222323
return (failure);
23232324
}
@@ -2800,6 +2801,8 @@ test_tlsext_clienthello_build(void)
28002801
goto err;
28012802
}
28022803

2804+
free(data);
2805+
data = NULL;
28032806
CBB_cleanup(&cbb);
28042807
CBB_init(&cbb, 0);
28052808

@@ -2917,6 +2920,8 @@ test_tlsext_serverhello_build(void)
29172920
}
29182921

29192922
CBB_cleanup(&cbb);
2923+
free(data);
2924+
data = NULL;
29202925
CBB_init(&cbb, 0);
29212926

29222927
/* Turn a few things on so we get extensions... */
@@ -3326,6 +3331,8 @@ test_tlsext_keyshare_server(void)
33263331
goto done;
33273332
}
33283333

3334+
tls_key_share_free(ssl->s3->hs.key_share);
3335+
33293336
if ((ssl->s3->hs.key_share =
33303337
tls_key_share_new_nid(NID_X25519)) == NULL) {
33313338
FAIL("failed to create key share");

0 commit comments

Comments
 (0)