fix: close resp body (#3364)

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [ ] 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 <your@email.example.org>`

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guoguangwu 2024-08-04 03:20:43 +08:00 committed by GitHub
parent 4d116ff0db
commit 5216e74b9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,6 +83,7 @@ func CreateSession(
if err != nil { if err != nil {
return "", err return "", err
} }
defer resp.Body.Close()
// Error if the status isn't OK // Error if the status isn't OK
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {