Skip to content

Commit dae84d8

Browse files
committed
make sure to close response body so we don't run out of handles
1 parent cde83d1 commit dae84d8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: indexer.go

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func MakeJSONRequest(method string, url string, body string, jsonStruct interfac
139139
l.WithError(err).Error("error making ES request")
140140
return resp, err
141141
}
142+
defer resp.Body.Close()
142143

143144
// if we have a body, try to decode it
144145
jsonBody, err := ioutil.ReadAll(resp.Body)

0 commit comments

Comments
 (0)