Subject: Re: [PATCH v2 1/4] xdiff: fix a memory leak

From: Junio C Hamano <[email-masked]>
Date: Wed, 16 Feb 2022 08:55:30 -0800

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

>> They are not dealing with it because they do not initialize it - it is
>> an "out" parameter that is used to return data to the caller. This
>> patch changes the logic to "whoever initializes it is responsible for
>> freeing it if there is an error". By doing that we localize the error
>> handling to xdl_do_diff() and can leave the callers unchanged.
>
> Yes, I'm saying that we're needlessly piling on complexity by continuing
> with this pattern in the xdiff/ codebase. I think it's fair to question
> the direction in general.

It is perfectly OK to question, but I'd prefer to see local
consistency.

Thanks.