From 670a3746b47e6147629afbf51e307236fadd6c00 Mon Sep 17 00:00:00 2001 From: Alexander Sokolov Date: Sun, 18 Apr 2021 22:46:22 +0300 Subject: [PATCH] Fix: Socket leaks if server returns RateLimitExceededStatus status. --- exporter/http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/exporter/http.go b/exporter/http.go index a0d8cc37..1bc63edc 100644 --- a/exporter/http.go +++ b/exporter/http.go @@ -146,6 +146,7 @@ func getHTTPResponse(url string, token string) (*http.Response, error) { // check rate limit exceeded. if resp.Status == RateLimitExceededStatus { + resp.Body.Close() return nil, fmt.Errorf("%s", resp.Status) }