diff --git a/cmd/geth/snapshot.go b/cmd/geth/snapshot.go index 5e1c784730..be1f9c99df 100644 --- a/cmd/geth/snapshot.go +++ b/cmd/geth/snapshot.go @@ -252,7 +252,9 @@ func checkDanglingStorage(ctx *cli.Context) error { stack, _ := makeConfigNode(ctx) defer stack.Close() - return snapshot.CheckDanglingStorage(utils.MakeChainDatabase(ctx, stack, true)) + db := utils.MakeChainDatabase(ctx, stack, true) + defer db.Close() + return snapshot.CheckDanglingStorage(db) } // traverseState is a helper function used for pruning verification.