diff --git a/memanalyze.pl b/memanalyze.pl index 3604db85d..03b7b62f8 100755 --- a/memanalyze.pl +++ b/memanalyze.pl @@ -80,19 +80,16 @@ while() { } } -if(0 == $totalmem) { - print "No leak found\n"; - exit; -} +if($totalmem) { + print "Leak detected: memory still allocated: $totalmem bytes\n"; -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"; + } } }