Re: [PATCH 1/5] pack-objects: plug leak in `read_stdin_packs()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 24, 2026, 07:39 UTC
- Message-ID
- <acI_pTWTcJN6QaK1@pks.im>
- In-Reply-To
- <1dac74f1e4a370097117754a6b1fbb6fa2b382a6.1773959041.git.me@ttaylorr.com>
On Thu, Mar 19, 2026 at 06:24:15PM -0400, Taylor Blau wrote:
Show 11 quoted lines
> 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