Skip to content

Commit ac0edd0

Browse files
Eslam-NawaraOmarabdul3ziz
authored andcommitted
close response body on getting zos config
1 parent 9f997b0 commit ac0edd0

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pkg/environment/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package environment
33
import (
44
"encoding/json"
55
"fmt"
6-
"io"
76
"net/http"
87
"sort"
98
"strings"
@@ -84,7 +83,9 @@ func getConfig(run RunMode, url string, httpClient *http.Client) (ext Config, er
8483
}
8584

8685
defer func() {
87-
_, _ = io.ReadAll(response.Body)
86+
if response != nil && response.Body != nil {
87+
response.Body.Close()
88+
}
8889
}()
8990

9091
if response.StatusCode != http.StatusOK {

0 commit comments

Comments
 (0)