Re: [PATCH 8/9] ref-filter: fix leak when formatting %(push:remoteref)
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 10, 2024, 06:09 UTC
- Message-ID
- <Zt_ihDoECjCKczfN@pks.im>
- In-Reply-To
- <20240909231951.GH921834@coredump.intra.peff.net>
On Mon, Sep 09, 2024 at 07:19:51PM -0400, Jeff King wrote:
Show 7 quoted lines
> When we expand the %(upstream) or %(push) placeholders, we rely on > remote.c's remote_ref_for_branch() to fill in the ":refname" argument. > But that function has confusing memory ownership semantics: it may or > may not return an allocated string, depending on whether we are in > "upstream" mode or "push" mode. The caller in ref-filter.c always > duplicates the result, meaning that we leak the original in the case of > %(push:refname).
Ah, I remember this issue, I think I also have it pending somewhere. Anyway, I'm happy if I can drop one more patch.
The change looks sensible to me.
Patrick