From 852eff278e2e291b6adc0f40db8cbced85ffdddc Mon Sep 17 00:00:00 2001 From: Ben Wells Date: Fri, 11 Sep 2020 20:11:08 +0100 Subject: [PATCH] Ensure response body is closed in DownloadAccessToken --- example/helper.go | 1 + 1 file changed, 1 insertion(+) diff --git a/example/helper.go b/example/helper.go index f920dad..66432b5 100644 --- a/example/helper.go +++ b/example/helper.go @@ -46,6 +46,7 @@ func DownloadAccessToken(url string, auth *osin.BasicAuth, output map[string]int if err != nil { return err } + defer presp.Body.Close() if presp.StatusCode != 200 { return errors.New("Invalid status code")