fix: all: fix resource leaks found by staticmajor (#13394)

Fixes resource leaks in which a .Close, .Stop method
wasn't invoked in return routes such as with errors.

Found by https://github.com/cosmos/cosmos-sdk/pull/13392
This commit is contained in:
Emmanuel T Odeke
2022-10-06 20:11:40 +00:00
committed by GitHub
parent fbd81ba0b7
commit 481569ce4f
8 changed files with 83 additions and 12 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ func startInProcess(cfg Config, val *Validator) error {
app := cfg.AppConstructor(*val)
genDocProvider := node.DefaultGenesisDocProviderFunc(tmCfg)
tmNode, err := node.NewNode(
tmNode, err := node.NewNode( //resleak:notresource
tmCfg,
pvm.LoadOrGenFilePV(tmCfg.PrivValidatorKeyFile(), tmCfg.PrivValidatorStateFile()),
nodeKey,