From: tb Date: Tue, 4 Jul 2023 08:47:01 +0000 (+0000) Subject: Plug leak in the ssltest X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=df6ddd9b8f1ab18c7102b6d72080b29deeaaa763;p=openbsd 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 --- 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();