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

Re: [PATCH] refs/files: prevent memory leak by freeing packed_ref_store

From
Sven Strickroth <email@cs-ware.de>
Date
Aug 5, 2024, 09:45 UTC
Message-ID
<8953733a-7553-4514-8990-866947b54ae7@cs-ware.de>
In-Reply-To
<ZrCPBXql7ySbEeXG@tanuki>
Am 05.08.2024 um 10:36 schrieb Patrick Steinhardt:
> That does highlight that `packed_ref_store_init()` is misnamed and
> really should be called `packed_ref_store_new()`, as it also allocates
> the structure itself. But that's a #leftoverbit for another day, I'd
> say.

This would also be true for ref for `files_ref_store_init` and `reftable_be_init`.

> Out of curiosity, did you hit this memory leak in some of our tests, or
> did you just happen to stumble over it by chance?
I found this while working on TortoiseGit which also uses libgit internally.
-- 
Best regards,
  Sven Strickroth
  PGP key id F5A9D4C4 @ any key-server
Previous: Patrick SteinhardtNext: Sven Strickroth via GitGitGadget
Message 3 of 6 in “refs/files: prevent memory leak by freeing packed_ref_store”
  1. refs/files: prevent memory leak by freeing packed_ref_storeSven Strickroth via GitGitGadget, Aug 3, 2024
  2. Patrick SteinhardtAug 5, 2024
  3. Sven StrickrothAug 5, 2024
  4. refs/files: prevent memory leak by freeing packed_ref_storeSven Strickroth via GitGitGadget, Aug 5, 2024
  5. Patrick SteinhardtAug 5, 2024
  6. Junio C HamanoAug 5, 2024

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.