From 4187776953fa2a053005eaca18cfb6ae2154398b Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Thu, 26 Feb 2026 00:27:15 +0000 Subject: [PATCH] fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon The `state.cookies` hashmap is initialized during daemon startup but never freed during cleanup in the `done:` label of fsmonitor_run_daemon(). Add a hashmap_clear() call to prevent this memory leak. Signed-off-by: Paul Tarjan Signed-off-by: Junio C Hamano --- builtin/fsmonitor--daemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index bc4571938c..4d52622e24 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -1404,6 +1404,7 @@ static int fsmonitor_run_daemon(void) done: pthread_cond_destroy(&state.cookies_cond); pthread_mutex_destroy(&state.main_lock); + hashmap_clear(&state.cookies); fsm_listen__dtor(&state); fsm_health__dtor(&state);