From d2df0b4c5f46f17844f2d6d966842fff33c86d3c Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Tue, 17 Aug 2021 16:11:59 -0500 Subject: [PATCH] Stack cleanup for subcommands --- cmd/geth/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index a5c73418f..8398d5313 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -315,8 +315,11 @@ func geth(ctx *cli.Context) error { prepare(ctx) stack, backend := makeFullNode(ctx) pluginsInitializeNode(stack, backend) + if ok, err := plugins.RunSubcommand(ctx); ok { + stack.Close() + return err + } defer stack.Close() - if ok, err := plugins.RunSubcommand(ctx); ok { return err } if !plugins.ParseFlags(ctx.Args()) { if args := ctx.Args(); len(args) > 0 { return fmt.Errorf("invalid command: %q", args[0])