From c6804e9854823b9f22d85ccff6b8e8d80d2ca83e Mon Sep 17 00:00:00 2001 From: Adam Chandler <31355738+AJChandler@users.noreply.github.com> Date: Thu, 21 Nov 2024 08:07:10 -0700 Subject: [PATCH] fix: Memory leak in repo-server (#20876) Signed-off-by: Adam Chandler --- util/app/discovery/discovery.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/app/discovery/discovery.go b/util/app/discovery/discovery.go index 580e4cd06935d..9f477e3a35a23 100644 --- a/util/app/discovery/discovery.go +++ b/util/app/discovery/discovery.go @@ -170,6 +170,7 @@ func cmpSupports(ctx context.Context, pluginSockFilePath, appPath, repoPath, fil cfg, err := cmpClient.CheckPluginConfiguration(ctx, &empty.Empty{}) if err != nil { log.Errorf("error checking plugin configuration %s, %v", fileName, err) + io.Close(conn) return nil, nil, false } @@ -178,6 +179,7 @@ func cmpSupports(ctx context.Context, pluginSockFilePath, appPath, repoPath, fil if namedPlugin { return conn, cmpClient, true } + io.Close(conn) return nil, nil, false }