git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] dir: fix leak of parent_hashmap and recursive_hashmap

From
Jeff King <peff@peff.net>
Date
Aug 16, 2020, 08:43 UTC
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:
Show 8 quoted lines
> From: Elijah Newren <newren@gmail.com>
> 
> 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
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren
Message 3 of 15 in “Clean up some memory leaks in and around dir.c”
  1. 0/3 Clean up some memory leaks in and around dir.cElijah Newren via GitGitGadget, Aug 16, 2020
  2. 1/3 dir: fix leak of parent_hashmap and recursive_hashmapElijah Newren via GitGitGadget, Aug 16, 2020
  3. Jeff KingAug 16, 2020
  4. Elijah NewrenAug 17, 2020
  5. 3/3 dir: fix problematic API to avoid memory leaksElijah Newren via GitGitGadget, Aug 16, 2020
  6. Jeff KingAug 16, 2020
  7. Elijah NewrenAug 17, 2020
  8. Jeff KingAug 17, 2020
  9. 2/3 dir: make clear_directory() free all relevant memoryElijah Newren via GitGitGadget, Aug 16, 2020
  10. Jeff KingAug 16, 2020
  11. Elijah NewrenAug 17, 2020
  12. 0/2 Clean up some memory leaks in and around dir.cElijah Newren via GitGitGadget, Aug 18, 2020
  13. 1/2 dir: make clear_directory() free all relevant memoryElijah Newren via GitGitGadget, Aug 18, 2020
  14. 2/2 dir: fix problematic API to avoid memory leaksElijah Newren via GitGitGadget, Aug 18, 2020
  15. Jeff KingAug 19, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.