aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-21 15:50:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-21 15:50:17 +0000
commit7db43ae0ed88328ebf6a0b9550a10e5b7e7a56a4 (patch)
treec75b0e51388b49fc221903ab854c4a1a0d58d9b0
parentae58d84429b933fceda1fb48b8cf3c9d17acaae0 (diff)
says nothing if no errors were found
-rwxr-xr-xmemanalyze.pl21
1 files changed, 9 insertions, 12 deletions
diff --git a/memanalyze.pl b/memanalyze.pl
index 3604db85d..03b7b62f8 100755
--- a/memanalyze.pl
+++ b/memanalyze.pl
@@ -80,19 +80,16 @@ while(<STDIN>) {
}
}
-if(0 == $totalmem) {
- print "No leak found\n";
- exit;
-}
-
-print "Leak detected: memory still allocated: $totalmem bytes\n";
+if($totalmem) {
+ print "Leak detected: memory still allocated: $totalmem bytes\n";
-for(keys %sizeataddr) {
- $addr = $_;
- $size = $sizeataddr{$addr};
- if($size) {
- print "At $addr, there's $size bytes.\n";
- print " allocated by ".$getmem{$addr}."\n";
+ for(keys %sizeataddr) {
+ $addr = $_;
+ $size = $sizeataddr{$addr};
+ if($size) {
+ print "At $addr, there's $size bytes.\n";
+ print " allocated by ".$getmem{$addr}."\n";
+ }
}
}