From e9dc53e5426cdcacb19fe4043e65617df6133e20 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 26 Jun 2022 14:50:39 +0400 Subject: [PATCH] Defer unix-socket remove only if a unix-socket actually being used. --- cmd/justcaptchad/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/justcaptchad/main.go b/cmd/justcaptchad/main.go index 91f3183..4757f12 100644 --- a/cmd/justcaptchad/main.go +++ b/cmd/justcaptchad/main.go @@ -28,11 +28,9 @@ func main() { return } - defer func() { - if !strings.ContainsRune(*listenAddress, ':') { - os.Remove(*listenAddress) - } - }() + if !strings.ContainsRune(*listenAddress, ':') { + defer os.Remove(*listenAddress) + } captcha.Init(*captchaExpire)