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

Re: [PATCH] packfile: release bad_objects in close_pack()

From
Jeff King <peff@peff.net>
Date
Sep 24, 2021, 20:21 UTC
Message-ID
<YU4zMj76HXP5PhCu@coredump.intra.peff.net>
In-Reply-To
<33a0120b-c10d-2709-49d3-7c3dc26565ee@web.de>
On Fri, Sep 24, 2021 at 08:10:10AM +0200, René Scharfe wrote:
Show 5 quoted lines
> Unusable entries of a damaged pack file are recorded in the oidset
> bad_objects.  Release it when we're done with the pack.
> 
> This doesn't affect intact packs because an empty oidset requires
> no allocation.

Good catch. I wondered if this was related to your recent 09ef66179b (packfile: use oidset for bad objects, 2021-09-11), but we'd have just leaked the manual array before then.

Show 10 quoted lines
> diff --git a/packfile.c b/packfile.c
> index 0e92bd7bd2..89402cfc69 100644
> --- a/packfile.c
> +++ b/packfile.c
> @@ -339,6 +339,7 @@ void close_pack(struct packed_git *p)
>  	close_pack_fd(p);
>  	close_pack_index(p);
>  	close_pack_revindex(p);
> +	oidset_clear(&p->bad_objects);
>  }
Looks obviously correct.
-Peff
Previous: René Scharfe
Message 2 of 2 in “packfile: release bad_objects in close_pack()”
  1. packfile: release bad_objects in close_pack()René Scharfe, Sep 24, 2021
  2. Jeff KingSep 24, 2021

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.