]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
memanalyze.pl: fix getaddrinfo/freeaddrinfo checks
authorDaniel Stenberg <daniel@haxx.se>
Sat, 31 May 2025 21:25:39 +0000 (23:25 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 1 Jun 2025 08:24:31 +0000 (10:24 +0200)
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

tests/memanalyze.pl

index 4e164fe38945c0c1c99ad0d1c9b934d17f0310f6..339da664e0170b0556a7e06dba86d57e8a9777ab 100755 (executable)
@@ -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) {