aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo_language_stats_nogogit.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-02-14 17:03:56 +0000
committerGitHub <noreply@github.com>2022-02-14 18:03:56 +0100
commit4482f62a26b5f66c1223b469b245ef8d65bae81a (patch)
treebd848527185e69855d4500c6a65a0c230764e187 /modules/git/repo_language_stats_nogogit.go
parent5348e198db6cd84467c99d6741715291b33598a1 (diff)
downloadgitea-4482f62a26b5f66c1223b469b245ef8d65bae81a.tar.gz
gitea-4482f62a26b5f66c1223b469b245ef8d65bae81a.zip
Prevent dangling GetAttribute calls (#18754)
It appears possible that there could be a hang due to unread data from the repo-attribute command pipes. This PR simply closes these during the defer. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/git/repo_language_stats_nogogit.go')
-rw-r--r--modules/git/repo_language_stats_nogogit.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/git/repo_language_stats_nogogit.go b/modules/git/repo_language_stats_nogogit.go
index 0b21bf6344..adb11dd8fa 100644
--- a/modules/git/repo_language_stats_nogogit.go
+++ b/modules/git/repo_language_stats_nogogit.go
@@ -88,7 +88,10 @@ func (repo *Repository) GetLanguageStats(commitID string) (map[string]int64, err
}
}()
}
- defer cancel()
+ defer func() {
+ _ = checker.Close()
+ cancel()
+ }()
}
}