From c3f1610f7a0b5a4e0022afb0eb60ff3416ec52a2 Mon Sep 17 00:00:00 2001 From: Shane Unruh Date: Wed, 27 Aug 2025 11:58:56 -0600 Subject: [PATCH] Added drain and close to doGroupMembersPut SMD leaks memory if the request is not fully read and closed. The DrainAndCloseRequestBody function was created to do this. This change adds a call to this in doGroupMembersPut. Signed-off-by: Shane Unruh --- cmd/smd/smd-api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/smd/smd-api.go b/cmd/smd/smd-api.go index 188ad9b..ca3e415 100644 --- a/cmd/smd/smd-api.go +++ b/cmd/smd/smd-api.go @@ -5128,6 +5128,7 @@ func (s *SmD) doGroupMembersPost(w http.ResponseWriter, r *http.Request) { // already exist in the group, they are added to the group. Any xnames that // exist in the group that are not in the payload are removed from the group. func (s *SmD) doGroupMembersPut(w http.ResponseWriter, r *http.Request) { + defer base.DrainAndCloseRequestBody(r) var membersIn sm.MemberPutBody label := sm.NormalizeGroupField(chi.URLParam(r, "group_label"))