Re: [PATCH v7 02/10] fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon
- From
- Paul Tarjan <paul@paultarjan.com>
- Date
- Mar 4, 2026, 18:17 UTC
- Message-ID
- <20260304181742.25634-1-github@paulisageek.com>
- In-Reply-To
- <aaficy025yUqsgN5@pks.im>
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().