Skip to content

Commit 6741e91

Browse files
committed
repository: avoid leaking fsmonitor data
The `fsmonitor` repo-setting data is allocated lazily. It needs to be released in `repo_clear()` along the rest of the allocated data in `repository`. This is needed because the next commit will merge v2.39.4, which will add a `git checkout --recurse-modules` call (which would leak memory without this here fix) to an otherwise leak-free test script. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0d1bd1d commit 6741e91

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

repository.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ void repo_clear(struct repository *repo)
271271
parsed_object_pool_clear(repo->parsed_objects);
272272
FREE_AND_NULL(repo->parsed_objects);
273273

274+
FREE_AND_NULL(repo->settings.fsmonitor);
275+
274276
if (repo->config) {
275277
git_configset_clear(repo->config);
276278
FREE_AND_NULL(repo->config);

0 commit comments

Comments
 (0)