Subject: Re: [PATCH v7 02/10] fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon

From: Paul Tarjan <[email-masked]>
Date: Wed, 4 Mar 2026 11:17:42 -0700

On Tue, Mar 4, 2026, Patrick Steinhardt wrote:
> Is this actually sufficient? as far as I can see, the cookies are
> inserted in `__wait_for_cookie()`, and each cookie also has a name
> attached to it that was allocated via a strbuf. So don't we have to
> free the name, as well?

You're right, the cookie names come from strbuf_detach() so they need
to be freed too. Fixed in v8: iterates and frees each name before
calling hashmap_clear_and_free().