From: Jeff King Date: Sun, 16 Aug 2020 08:43:28 GMT Subject: Re: [PATCH 1/3] dir: fix leak of parent_hashmap and recursive_hashmap Message-ID: <20200816084328.GA1221900@coredump.intra.peff.net> In-Reply-To: <932741d7598ca2934dbca40f715ba2d3819fcc51.1597561152.git.gitgitgadget@gmail.com> On Sun, Aug 16, 2020 at 06:59:09AM +0000, Elijah Newren via GitGitGadget wrote: > From: Elijah Newren > > Commit 96cc8ab531 ("sparse-checkout: use hashmaps for cone patterns", > 2019-11-21) added a parent_hashmap and recursive_hashmap to each struct > pattern_list and initialized these in add_patterns_from_buffer() but did > not make sure to add necessary code to clear_pattern_list() to free > these new structures. Call hashmap_free_() on each to plug this memory > leak. Beat you to it. :) See: https://lore.kernel.org/git/20200814111049.GA4101811@coredump.intra.peff.net/ -Peff