From 6690822e09ecb550aa2e5ecf835b0cd8632c48e7 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 Signed-off-by: Adrian Aneci --- 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 }