From dd2b3a04a46d84d8ce0ea04a3c1440318e8beb32 Mon Sep 17 00:00:00 2001 From: guangwu Date: Fri, 19 Apr 2024 16:44:38 +0800 Subject: [PATCH] fix: close resp body 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 d61052cc0..5a57ef9c3 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 {