Subject: Re: [PATCH 1/5] pack-objects: plug leak in `read_stdin_packs()`

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 24 Mar 2026 08:39:17 +0100

On Thu, Mar 19, 2026 at 06:24:15PM -0400, Taylor Blau wrote:
> The `read_stdin_packs()` function added originally via 339bce27f4f
> (builtin/pack-objects.c: add '--stdin-packs' option, 2021-02-22)
> declares a `rev_info` struct but neglects to call `release_revisions()`
> on it before returning, creating a leak.
> 
> The related change in 97ec43247c0 (pack-objects: declare 'rev_info' for
> '--stdin-packs' earlier, 2025-06-23) carried forward this oversight and
> did not address it.
> 
> Ensure that we call `release_revisions()` appropriately to prevent a
> leak from this function.

Would be curious to learn why none of our tests fail with this. The fix
looks obviously correct though, and there are no other early exits that
might need fixing here.

Patrick