Re: [PATCH 6/6] repack: stop leaking a "struct child_process"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 22, 2021, 00:22 UTC
- Message-ID
- <xmqqa6j1gb7f.fsf@gitster.g>
- In-Reply-To
- <patch-6.6-526d5649156-20211021T155529Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 21 quoted lines
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
> builtin/repack.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/repack.c b/builtin/repack.c
> index 0b2d1e5d82b..50730517c7b 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -258,9 +258,11 @@ static void repack_promisor_objects(const struct pack_objects_args *args,
> for_each_packed_object(write_oid, &cmd,
> FOR_EACH_OBJECT_PROMISOR_ONLY);
>
> - if (cmd.in == -1)
> + if (cmd.in == -1) {
> + child_process_clear(&cmd);
> /* No packed objects; cmd was never started */
> return;
> + }
>
> close(cmd.in);Not wrong per-se, but let's take the one that is part of Taylor's "plug pack bitmap leaks" series that plugs the same leak.