From 45852ca3e7d7a5694d5d7bccf51fdc57c9a3bae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 5 Mar 2023 11:26:19 +0800 Subject: [PATCH] Fix check config --- cmd/sing-box/cmd_check.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }