From 597f22f2cdcc6dc07e75649484cdcfdd9513ee6f Mon Sep 17 00:00:00 2001 From: Justin Gallardo Date: Mon, 15 May 2023 10:54:31 -0700 Subject: [PATCH] Close manager request body --- pkg/connector/users.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/connector/users.go b/pkg/connector/users.go index 6fd3a64..10cc398 100644 --- a/pkg/connector/users.go +++ b/pkg/connector/users.go @@ -129,7 +129,7 @@ func (o *userResourceType) userTrait(ctx context.Context, user *jcapi1.Systemuse profile.Fields["manager_id"] = structpb.NewStringValue(managerID) manager, ok = o.managers[managerID] if !ok { - m, _, err := client.SystemusersApi.SystemusersGet(ctx, managerID).Execute() + m, resp, err := client.SystemusersApi.SystemusersGet(ctx, managerID).Execute() if err != nil { l.Error( "baton-jumpcloud: failed to fetch manager details", @@ -138,6 +138,8 @@ func (o *userResourceType) userTrait(ctx context.Context, user *jcapi1.Systemuse zap.String("manager_id", managerID), ) } + defer resp.Body.Close() + manager = m o.managers[user.GetManager()] = m }