Support realloc() on a NULL pointer properly (printf(%p) on a NULL pointer

outputs (nil) and not a 0x0 or similar.
This commit is contained in:
Daniel Stenberg 2005-08-04 23:05:36 +00:00
parent 82cb462bb4
commit 6508d446e1
1 changed files with 2 additions and 4 deletions

View File

@ -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) {