From 496a742d20e581f60abcdfa8993a67ba95064d81 Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 22 May 2024 14:13:30 +0800 Subject: [PATCH] fix: close resp body (#124) --- server/hooks/wechat_push/wechat_push.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/hooks/wechat_push/wechat_push.go b/server/hooks/wechat_push/wechat_push.go index 173ba66..334043d 100644 --- a/server/hooks/wechat_push/wechat_push.go +++ b/server/hooks/wechat_push/wechat_push.go @@ -72,6 +72,7 @@ func (w *WeChatPushHook) getWxAccessToken() string { if err != nil { return "" } + defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) var ret accessTokenRes _ = json.Unmarshal(body, &ret)