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

Re: [PATCH v2] fill_oids_from_packs: fix memory leak when fill_oids_from_packs failed

From
Patrick Steinhardt <ps@pks.im>
Date
May 9, 2025, 08:25 UTC
Message-ID
<aB2765DnIjb1xDQW@pks.im>
In-Reply-To
<pull.1957.v2.git.git.1746774869081.gitgitgadget@gmail.com>
On Fri, May 09, 2025 at 07:14:28AM +0000, Lidong Yan via GitGitGadget wrote:
Show 5 quoted lines
> From: Lidong Yan <502024330056@smail.nju.edu.cn>
> 
> In commit-graph.c:fill_oids_from_packs, if open_pack_index failed,
> memory allocated and returned by add_packed_git will leak. Simply
> add close_pack and free(p) will solve this problem.

One more thing that I missed in the first review: the commit subject should mention the subsystem as prefix, not the specific function. So It should e.g. read:

    commit-grap: fix memory leak when `fill_oids_from_packs()` fails
Patrick
Previous: Lidong Yan via GitGitGadgetNext: Lidong Yan via GitGitGadget
Message 5 of 7 in “fill_oids_from_packs: fix memory leak when fill_oids_from_packs failed”
  1. fill_oids_from_packs: fix memory leak when fill_oids_from_packs failedLidong Yan via GitGitGadget, May 8, 2025
  2. Patrick SteinhardtMay 9, 2025
  3. lidongyanMay 9, 2025
  4. fill_oids_from_packs: fix memory leak when fill_oids_from_packs failedLidong Yan via GitGitGadget, May 9, 2025
  5. Patrick SteinhardtMay 9, 2025
  6. commit-grap: fix memory leak when `fill_oids_from_packs()` failsLidong Yan via GitGitGadget, May 9, 2025
  7. Junio C HamanoMay 15, 2025

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.