From 5216e74b9ade31e861d3f18a7a1b0e82ee0db5f6 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Sun, 4 Aug 2024 03:20:43 +0800 Subject: fix: close resp body (#3364) ### Pull Request Checklist * [ ] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [ ] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: `Your Name ` Signed-off-by: guoguangwu --- clientapi/threepid/threepid.go | 1 + 1 file changed, 1 insertion(+) diff --git a/clientapi/threepid/threepid.go b/clientapi/threepid/threepid.go index d61052cc..5a57ef9c 100644 --- a/clientapi/threepid/threepid.go +++ b/clientapi/threepid/threepid.go @@ -83,6 +83,7 @@ func CreateSession( if err != nil { return "", err } + defer resp.Body.Close() // Error if the status isn't OK if resp.StatusCode != http.StatusOK { -- cgit v1.2.3