diff --git a/cmd/sing-box/cmd_check.go b/cmd/sing-box/cmd_check.go index 0d7fb527..dfe95514 100644 --- a/cmd/sing-box/cmd_check.go +++ b/cmd/sing-box/cmd_check.go @@ -31,7 +31,10 @@ func check() error { return err } ctx, cancel := context.WithCancel(context.Background()) - _, err = box.New(ctx, options, nil) + instance, err := box.New(ctx, options, nil) + if err == nil { + instance.Close() + } cancel() return err }