From: Patrick Steinhardt <ps@pks.im>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] cache-tree: refactor verification to return error codes
Date: Wed, 18 Sep 2024 07:11:31 +0200 [thread overview]
Message-ID: <Zupg_VUWOfa_i7kU@pks.im> (raw)
In-Reply-To: <CAPig+cQ472dzChHKgrL_DNRe4KMNHNVxR1Qh3n6M=OgtBkG1+w@mail.gmail.com>
On Tue, Sep 17, 2024 at 01:05:50PM -0400, Eric Sunshine wrote:
> On Tue, Sep 17, 2024 at 3:13 AM Patrick Steinhardt <ps@pks.im> wrote:
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > diff --git a/cache-tree.c b/cache-tree.c
> > @@ -890,18 +892,23 @@ static int verify_one(struct repository *r,
> > struct strbuf tree_buf = STRBUF_INIT;
> > for (i = 0; i < it->subtree_nr; i++) {
> > strbuf_addf(path, "%s/", it->down[i]->name);
> > - if (verify_one(r, istate, it->down[i]->cache_tree, path))
> > - return 1;
> > + ret = verify_one(r, istate, it->down[i]->cache_tree, path);
> > + if (ret)
> > + goto out;
>
> Assuming I am understanding correctly that the original code was
> leaking the strbuf by returning early, I was surprised that the commit
> message didn't mention that the patch is also fixing the leak.
> (Probably not worth a reroll, though.)
It just wasn't my main motivation here, so I forgot to mention it. Added
it now though, so it's included in case I'll have to reroll. Thanks!
Patrick
next prev parent reply other threads:[~2024-09-18 5:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 7:13 [PATCH 0/3] cache-tree: fix segfaults with invalid cache-trees Patrick Steinhardt
2024-09-17 7:13 ` [PATCH 1/3] cache-tree: refactor verification to return error codes Patrick Steinhardt
2024-09-17 17:05 ` Eric Sunshine
2024-09-18 5:11 ` Patrick Steinhardt [this message]
2024-09-17 7:13 ` [PATCH 2/3] cache-tree: detect mismatching number of index entries Patrick Steinhardt
2024-09-19 1:35 ` Junio C Hamano
2024-09-24 6:48 ` Patrick Steinhardt
2024-09-24 17:01 ` Junio C Hamano
2024-09-17 7:13 ` [PATCH 3/3] unpack-trees: detect mismatching number of cache-tree/index entries Patrick Steinhardt
2024-10-07 4:38 ` [PATCH v2 0/3] cache-tree: fix segfaults with invalid cache-trees Patrick Steinhardt
2024-10-07 4:38 ` [PATCH v2 1/3] cache-tree: refactor verification to return error codes Patrick Steinhardt
2024-10-07 4:38 ` [PATCH v2 2/3] cache-tree: detect mismatching number of index entries Patrick Steinhardt
2024-10-07 4:38 ` [PATCH v2 3/3] unpack-trees: detect mismatching number of cache-tree/index entries Patrick Steinhardt
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zupg_VUWOfa_i7kU@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
/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.
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 NNTP newsgroup(s).