Re: [PATCH v2 4/6] log: fix common "rev.pending" memory leak in "git show"
- From
Jeff King <peff@peff.net>
- Date
- Jul 29, 2022, 18:59 UTC
- Message-ID
- <YuQt9rKMJek0rEDx@coredump.intra.peff.net>
- In-Reply-To
- <patch-v2-4.6-54b632c1124-20220729T082919Z-avarab@gmail.com>
On Fri, Jul 29, 2022 at 10:31:06AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 7 quoted lines
> So in addition to the now-populated &pending array, to avoid leaking > the memory related to the one member array we've created. The > &rev.pending was already being object_array_clear()'d by the > release_revisions() added in f6bfea0ad01 (revisions API users: use > release_revisions() in builtin/log.c, 2022-04-13), now we'll also > correctly free the previous data (f6bfea0ad01 noted this memory leak > as an outstanding TODO).
I couldn't quite parse the first sentence. But I think this explanation is proceeding along a wrong assumption (which is the same one I had when reviewing v1) that we are leaking the one-member array. I think this paragraph can be replaced with something along the lines of what I mentioned in my other reply.
-Peff