Handle previously unhandled error

This commit is contained in:
2018-07-08 18:36:42 +01:00
parent 957e7a2479
commit f6e485a2a3
2 changed files with 6 additions and 3 deletions

View File

@@ -39,7 +39,10 @@ objects are present in both B and C, and not present in A.`,
case "hex":
finder.PrintLeakedAddresses()
case "json":
finder.PrintLeakedObjects()
err := finder.PrintLeakedObjects()
if err != nil {
er(err)
}
default:
usage_er(
cmd,

View File

@@ -48,9 +48,9 @@ func (s *Finder) PrintLeakedAddresses() {
s.Dumps[1].PrintEntryAddress(s.FindLeaks())
}
func (s *Finder) PrintLeakedObjects() {
func (s *Finder) PrintLeakedObjects() error {
s.log("\nLeaked Objects:")
s.Dumps[1].PrintEntryJSON(s.FindLeaks())
return s.Dumps[1].PrintEntryJSON(s.FindLeaks())
}
func (s *Finder) FindLeaks() []*string {