diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-04 08:47:02 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-04 08:47:02 +0000 |
commit | fcc28cd8fba3ba6f40b35571e5963e69c5716def (patch) | |
tree | b8a01cb75600f970b5704bd733c2bbde26b1e885 /regress | |
parent | ae57891577923691a9a0f30c896d74134f489612 (diff) |
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 'regress')
-rw-r--r-- | regress/lib/libssl/ssl/ssltest.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/regress/lib/libssl/ssl/ssltest.c b/regress/lib/libssl/ssl/ssltest.c index 6b8e2430735..f3966e50542 100644 --- a/regress/lib/libssl/ssl/ssltest.c +++ b/regress/lib/libssl/ssl/ssltest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssltest.c,v 1.40 2023/07/02 17:21:32 beck Exp $ */ +/* $OpenBSD: ssltest.c,v 1.41 2023/07/04 08:47:01 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -254,6 +254,7 @@ cb_server_alpn(SSL *s, const unsigned char **out, unsigned char *outlen, * Make a copy of the selected protocol which will be freed in * verify_alpn. */ + free(alpn_selected); if ((alpn_selected = malloc(*outlen)) == NULL) { fprintf(stderr, "malloc failed\n"); abort(); |