From: Daniel Stenberg Date: Sat, 31 May 2025 21:25:39 +0000 (+0200) Subject: memanalyze.pl: fix getaddrinfo/freeaddrinfo checks X-Git-Tag: curl-8_14_1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70115763c3e09b3b3b31b4fda16053026f316fb9;p=thirdparty%2Fcurl.git memanalyze.pl: fix getaddrinfo/freeaddrinfo checks It did not parse them correctly. Problem never shows before we don't run torture tests with these functions - yet. Seen when enabling torture tests with the threaded resolver. Closes #17503 --- diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index 4e164fe389..339da664e0 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -343,7 +343,7 @@ while(<$fileh>) { $function = $3; if($function =~ /getaddrinfo\(\) = (\(nil\)|0x([0-9a-f]*))/) { - my $add = $2; + my $add = $1; if($add eq "(nil)") { ; } @@ -357,12 +357,13 @@ while(<$fileh>) { } } # fclose(0x1026c8) - elsif($function =~ /freeaddrinfo\(0x([0-9a-f]*)\)/) { - if(!$addrinfo{$1}) { + elsif($function =~ /freeaddrinfo\((0x[0-9a-f]*)\)/) { + my $addr = $1; + if(!$addrinfo{$addr}) { print "freeaddrinfo() without getaddrinfo(): $line\n"; } else { - $addrinfo{$1}=0; + $addrinfo{$addr}=0; $addrinfos--; } if($trace) {