From: Daniel Stenberg Date: Thu, 4 Aug 2005 23:05:36 +0000 (+0000) Subject: Support realloc() on a NULL pointer properly (printf(%p) on a NULL pointer X-Git-Tag: curl-7_14_1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6508d446e1511a29587c9df90228ec9bd4217ada;p=thirdparty%2Fcurl.git Support realloc() on a NULL pointer properly (printf(%p) on a NULL pointer outputs (nil) and not a 0x0 or similar. --- diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index b8f17b5501..b6bc967149 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -158,10 +158,8 @@ while() { $getmem{$addr}="$source:$linenum"; } - elsif($function =~ /realloc\(0x([0-9a-f]*), (\d*)\) = 0x([0-9a-f]*)/) { - $oldaddr = $1; - $newsize = $2; - $newaddr = $3; + elsif($function =~ /realloc\((\(nil\)|0x([0-9a-f]*)), (\d*)\) = 0x([0-9a-f]*)/) { + my ($oldaddr, $newsize, $newaddr) = ($2, $3, $4); $totalmem -= $sizeataddr{$oldaddr}; if($trace) {