From d838b871e436d1c044d35681ba25b4b8fb638d74 Mon Sep 17 00:00:00 2001 From: windvalley Date: Tue, 17 Dec 2024 14:10:58 +0800 Subject: [PATCH] fix(command): ensure session is properly closed --- pkg/batchssh/batchssh.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/batchssh/batchssh.go b/pkg/batchssh/batchssh.go index 92ef87d..87fa0cf 100644 --- a/pkg/batchssh/batchssh.go +++ b/pkg/batchssh/batchssh.go @@ -177,6 +177,7 @@ func (c *Client) ExecuteCmd(host *Host, command, lang, runAs string, sudo bool) if err != nil { return "", err } + defer session.Close() exportLang := "" if lang != "" {