diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-03-20 01:25:37 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-20 01:25:37 +0300 |
commit | 1dd4e7452295618b20703deffc4241bf7dd4be4f (patch) | |
tree | a8390c1f3eafd563988d9c2fafe8ad680d7ecc4b /read-cache.c | |
parent | 35381b13da846cc6ad620f9f9a5abf1d974d6e9b (diff) | |
parent | 4abc57848d8ace8218952c7376fa397c0850392c (diff) |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c index 1e9a50c6c7..b36838e74b 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); |