From: Jeff King <peff@peff.net>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] packfile: release bad_objects in close_pack()
Date: Fri, 24 Sep 2021 16:21:06 -0400 [thread overview]
Message-ID: <YU4zMj76HXP5PhCu@coredump.intra.peff.net> (raw)
In-Reply-To: <33a0120b-c10d-2709-49d3-7c3dc26565ee@web.de>
On Fri, Sep 24, 2021 at 08:10:10AM +0200, René Scharfe wrote:
> 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.
> 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
prev parent reply other threads:[~2021-09-24 20:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 6:10 [PATCH] packfile: release bad_objects in close_pack() René Scharfe
2021-09-24 20:21 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YU4zMj76HXP5PhCu@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).