Re: [PATCH v2 1/4] xdiff: fix a memory leak
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 16, 2022, 16:55 UTC
- Message-ID
- <xmqq7d9uvji5.fsf@gitster.g>
- In-Reply-To
- <220216.86h78yuar0.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 9 quoted lines
>> 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.