summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-07-04 08:47:01 +0000
committertb <>2023-07-04 08:47:01 +0000
commitaa6ae09c992307573b17674b1e762095dfd12da6 (patch)
treee1b32840497f197156b9466484af8e9ef9446b0d /src
parent127efe31f6e78fc619e5922fdb2f786aff562d44 (diff)
downloadopenbsd-aa6ae09c992307573b17674b1e762095dfd12da6.tar.gz
openbsd-aa6ae09c992307573b17674b1e762095dfd12da6.tar.bz2
openbsd-aa6ae09c992307573b17674b1e762095dfd12da6.zip
Plug leak in the ssltest
Removing -tls1 moved some tests from the legacy stack to the TLSv1.3 stack. On a HRR, the alpn callback would be called twice and allocate the global twice, thereby leaking. So free it up front. Joint suffering with bcook and beck
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/ssl/ssltest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c
index 6b8e243073..f3966e5054 100644
--- a/src/regress/lib/libssl/ssl/ssltest.c
+++ b/src/regress/lib/libssl/ssl/ssltest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssltest.c,v 1.40 2023/07/02 17:21:32 beck Exp $ */ 1/* $OpenBSD: ssltest.c,v 1.41 2023/07/04 08:47:01 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -254,6 +254,7 @@ cb_server_alpn(SSL *s, const unsigned char **out, unsigned char *outlen,
254 * Make a copy of the selected protocol which will be freed in 254 * Make a copy of the selected protocol which will be freed in
255 * verify_alpn. 255 * verify_alpn.
256 */ 256 */
257 free(alpn_selected);
257 if ((alpn_selected = malloc(*outlen)) == NULL) { 258 if ((alpn_selected = malloc(*outlen)) == NULL) {
258 fprintf(stderr, "malloc failed\n"); 259 fprintf(stderr, "malloc failed\n");
259 abort(); 260 abort();