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

Re: [PATCH 2/2] read-cache: free hash context in do_write_index()

From
Patrick Steinhardt <ps@pks.im>
Date
Sep 30, 2024, 12:32 UTC
Message-ID
<ZvqaRIY1OzOIh1bc@pks.im>
In-Reply-To
<b6fe5b3ef7e5f4ac8cc339685d92e3ac39fcb456.1727696424.git.gitgitgadget@gmail.com>
On Mon, Sep 30, 2024 at 11:40:24AM +0000, Derrick Stolee via GitGitGadget wrote:
Show 21 quoted lines
> From: Derrick Stolee <stolee@gmail.com>
> 
> While writing an index, a 'git_hash_ctx' is allocated for hashing the
> file contents. This should be freed as the method exits.
> 
> Signed-off-by: Derrick Stolee <stolee@gmail.com>
> ---
>  read-cache.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/read-cache.c b/read-cache.c
> index 3c078afadbc..51845c2e611 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -3126,6 +3126,7 @@ out:
>  		free_hashfile(f);
>  	strbuf_release(&sb);
>  	free(ieot);
> +	free(eoie_c);
>  	return ret;
>  }

Yup, this one looks correct. I've sent out an equivalent patch via [1] a couple hours ago.

Patrick
[1]: https://lore.kernel.org/git/c51f40c5bd0c56967e348363e784222de7884b79.1727687410.git.ps@pks.im/
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 7 of 11 in “read-cache: two small leak fixes”
  1. 0/2 read-cache: two small leak fixesDerrick Stolee via GitGitGadget, Sep 30, 2024
  2. 1/2 read-cache: free threaded memory poolDerrick Stolee via GitGitGadget, Sep 30, 2024
  3. Patrick SteinhardtSep 30, 2024
  4. Derrick StoleeOct 1, 2024
  5. Patrick SteinhardtOct 1, 2024
  6. 2/2 read-cache: free hash context in do_write_index()Derrick Stolee via GitGitGadget, Sep 30, 2024
  7. Patrick SteinhardtSep 30, 2024
  8. Derrick StoleeOct 1, 2024
  9. Patrick SteinhardtOct 1, 2024
  10. read-cache: free threaded memory poolDerrick Stolee via GitGitGadget, Oct 1, 2024
  11. Patrick SteinhardtOct 2, 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.