diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2015-03-09 19:01:08 -0400 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-03-10 22:05:46 +0100 |
commit | f39b1c080129c01c8204d3a5a40aad038c7a57f3 (patch) | |
tree | 0344965a55761be54339ed3e004f9596594a526e /tests/memanalyze.pl | |
parent | e424a1b3e794a9a98c255843a3c3bc9b5a7832a1 (diff) | |
download | curl-f39b1c080129c01c8204d3a5a40aad038c7a57f3.tar.gz |
memanalyze.pl: handle free(NULL)
Diffstat (limited to 'tests/memanalyze.pl')
-rwxr-xr-x | tests/memanalyze.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index 54117f8ea..701cf161c 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -108,9 +108,12 @@ while(<FILE>) { $linenum = $2; $function = $3; - if($function =~ /free\(0x([0-9a-f]*)/) { - $addr = $1; - if(!exists $sizeataddr{$addr}) { + if($function =~ /free\((\(nil\)|0x([0-9a-f]*))/) { + $addr = $2; + if($1 eq "(nil)") { + ; # do nothing when free(NULL) + } + elsif(!exists $sizeataddr{$addr}) { print "FREE ERROR: No memory allocated: $line\n"; } elsif(-1 == $sizeataddr{$addr}) { |