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 <github@paulisageek.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Paul Tarjan
2026-02-26 00:27:15 +00:00
committed by Junio C Hamano
parent 0ecf18fc7e
commit 4187776953

View File

@@ -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);