* libwget/ssl_wolfssl.c (wget_ssl_open): Fix memory leak

This commit is contained in:
Tim Rühsen
2022-01-01 18:42:54 +01:00
parent c5e393f818
commit d3fcdf51ee

View File

@ -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;