From 187a0c8817e6ecfe446712bb3f9db4e040776bd1 Mon Sep 17 00:00:00 2001 From: Hekmon Date: Fri, 29 Apr 2022 11:43:43 +0200 Subject: [PATCH] add missing defer --- crunchyroll.go | 1 + 1 file changed, 1 insertion(+) diff --git a/crunchyroll.go b/crunchyroll.go index 8ae0932..bf20ed8 100644 --- a/crunchyroll.go +++ b/crunchyroll.go @@ -244,6 +244,7 @@ func (c *Crunchyroll) request(endpoint string) (*http.Response, error) { resp, err := c.Client.Do(req) if err == nil { + defer resp.Body.Close() bodyAsBytes, _ := io.ReadAll(resp.Body) defer resp.Body.Close() if resp.StatusCode == http.StatusUnauthorized {