Thread (5 messages) 5 messages, 3 authors, 2021-03-19

[PATCH 2/2] fsmonitor: do not forget to release the token in `discard_index()`

flat view
STALE2032d

From: Johannes Schindelin via GitGitGadget <hidden>
Date: 2021-03-17 16:02:06
Subsystem: the rest · Maintainer: Linus Torvalds

From: Johannes Schindelin <redacted>

In 56c6910028a (fsmonitor: change last update timestamp on the
index_state to opaque token, 2020-01-07), we forgot to adjust
`discard_index()` to release the "last-update" token: it is no longer a
64-bit number, but a free-form string that has been allocated.

Signed-off-by: Johannes Schindelin <redacted>
---
 read-cache.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/read-cache.c b/read-cache.c
index aa427c5c170f..cf5ff3158550 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2364,6 +2364,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);
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help