aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-08-04 23:05:36 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-08-04 23:05:36 +0000
commit6508d446e1511a29587c9df90228ec9bd4217ada (patch)
treefa8cc6c8c1bc1d403b48e1be5e2a9f80c7cc5d8a
parent82cb462bb403b6282e71afff1eb870b23645f68a (diff)
Support realloc() on a NULL pointer properly (printf(%p) on a NULL pointer
outputs (nil) and not a 0x0 or similar.
-rwxr-xr-xtests/memanalyze.pl6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl
index b8f17b550..b6bc96714 100755
--- a/tests/memanalyze.pl
+++ b/tests/memanalyze.pl
@@ -158,10 +158,8 @@ while(<FILE>) {
$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) {