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 {