From d3fcdf51ee4ed757dba511a6f1f850ef4e514fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Sat, 1 Jan 2022 18:42:54 +0100 Subject: [PATCH] * libwget/ssl_wolfssl.c (wget_ssl_open): Fix memory leak --- libwget/ssl_wolfssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libwget/ssl_wolfssl.c b/libwget/ssl_wolfssl.c index eb89f077..04ea6dce 100644 --- a/libwget/ssl_wolfssl.c +++ b/libwget/ssl_wolfssl.c @@ -934,7 +934,8 @@ int wget_ssl_open(wget_tcp *tcp) debug_printf("WolfSSL: Failed to connect ALPN\n"); else { debug_printf("WolfSSL: Server accepted ALPN protocol '%.*s'\n", (int) protocol_length, protocol); - stats.alpn_protocol = wget_strmemdup(protocol, protocol_length); + if (tls_stats_callback) + stats.alpn_protocol = wget_strmemdup(protocol, protocol_length); if (protocol_length == 2 && !memcmp(protocol, "h2", 2)) { tcp->protocol = WGET_PROTOCOL_HTTP_2_0;