From 59a09b0ff30470577deaa3383e3f70dcfcf6c90e Mon Sep 17 00:00:00 2001 From: jnfrati Date: Mon, 6 Jul 2026 13:35:19 +0200 Subject: [PATCH] fix lint issue on body close --- client/internal/portforward/upnp/upnp.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/internal/portforward/upnp/upnp.go b/client/internal/portforward/upnp/upnp.go index cf2f46d4b..846d6f613 100644 --- a/client/internal/portforward/upnp/upnp.go +++ b/client/internal/portforward/upnp/upnp.go @@ -124,13 +124,18 @@ func search(client *httpu.HTTPUClient, gatewayAddr, searchTarget string) ([]stri }, } - responses, err := client.Do(req, searchTimeout, searchRepeats) + responses, err := client.Do(req, searchTimeout, searchRepeats) //nolint:bodyclose // httpu.Do returns a slice; bodies are closed in the loop below. if err != nil { return nil, err } var locations []string for _, resp := range responses { + if resp.Body != nil { + if err := resp.Body.Close(); err != nil { + log.Debugf("close SSDP response body: %v", err) + } + } if resp.StatusCode != http.StatusOK { continue }