summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-19 22:25:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-19 22:25:37 (GMT)
commit1dd4e7452295618b20703deffc4241bf7dd4be4f (patch)
treea8390c1f3eafd563988d9c2fafe8ad680d7ecc4b /read-cache.c
parent35381b13da846cc6ad620f9f9a5abf1d974d6e9b (diff)
parent4abc57848d8ace8218952c7376fa397c0850392c (diff)
downloadgit-1dd4e7452295618b20703deffc4241bf7dd4be4f.zip
git-1dd4e7452295618b20703deffc4241bf7dd4be4f.tar.gz
git-1dd4e7452295618b20703deffc4241bf7dd4be4f.tar.bz2
Merge branch 'js/fsmonitor-unpack-fix'
The data structure used by fsmonitor interface was not properly duplicated during an in-core merge, leading to use-after-free etc. * js/fsmonitor-unpack-fix: fsmonitor: do not forget to release the token in `discard_index()` fsmonitor: fix memory corruption in some corner cases
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 1e9a50c..b36838e 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2373,6 +2373,7 @@ int discard_index(struct index_state *istate)
cache_tree_free(&(istate->cache_tree));
istate->initialized = 0;
istate->fsmonitor_has_run_once = 0;
+ FREE_AND_NULL(istate->fsmonitor_last_update);
FREE_AND_NULL(istate->cache);
istate->cache_alloc = 0;
discard_split_index(istate);