From 3b07c912bc68581ef165890630df4b1318b9f821 Mon Sep 17 00:00:00 2001 From: Adam Chandler Date: Wed, 20 Nov 2024 15:17:10 -0700 Subject: [PATCH] fix: Memory leak in repo-server 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 }