From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Eric Wong <e@80x24.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] delta-islands: free island_marks and bitmaps
Date: Thu, 02 Feb 2023 02:45:30 +0100 [thread overview]
Message-ID: <230202.86mt5wq1i7.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <20230202010353.23391-1-e@80x24.org>
On Thu, Feb 02 2023, Eric Wong wrote:
> + kh_foreach_value(island_marks, bitmap, {
> + if (--bitmap->refcount == 0)
Style nit: if (!--x) rather than if (--x == 0) ?
> + free(bitmap);
> + });
> + kh_destroy_oid_map(island_marks);
> + island_marks = (void *)1; /* crash on unintended future use */
This seems counter-productive. If you just leave it free'd then various
analysis tools will spot a use-after-free earlier, won't they?
next prev parent reply other threads:[~2023-02-02 1:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 1:03 [PATCH] delta-islands: free island_marks and bitmaps Eric Wong
2023-02-02 1:45 ` Ævar Arnfjörð Bjarmason [this message]
2023-02-02 9:42 ` [PATCH v2] " Eric Wong
2023-02-03 18:11 ` Jeff King
2023-02-03 23:44 ` [PATCH v3] " Eric Wong
2023-02-04 11:14 ` Jeff King
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=230202.86mt5wq1i7.gmgdl@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
/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).