Re: [PATCH] bundle-uri: plug leak in unbundle_from_file()
- From
Toon Claes <toon@iotcl.com>
- Date
- Oct 10, 2024, 09:15 UTC
- Message-ID
- <875xq0s4in.fsf@iotcl.com>
- In-Reply-To
- <xmqqle0jmfpf.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> Both of two callers of unbundle_from_file() are used as the > condition of an if() statement, so unbundle() that signals an error > with -1 wouldn't be a problem, I would think.
Show 7 quoted lines
> It may not be a bad idea as a #leftoverbits item, after the dust > settles, to clean up the calling convention in this file (may not be > limited to the code path that reaches this function) to follow the > usual "signal success with 0, failures are signalled with a negative > value". Then we can just return the value we got from a failing > read_bundle_header(), just the same way we return the value we got > from a failing unbundle().
I just submitted v2 which preserves the original return values as before. I'll leave changing any return value to a #leftoverbits series to addresses them together.
-- Toon