# Re: \[PATCH 1/2\] tree-diff: fix leak when not HAVE\_ALLOCA

- From: Junio C Hamano \<hidden\>
- Date: 2021-09-16 05:28:02 
- List: git
- Page: https://ratatoskr.run/git/2021/09/7902645
- Thread: https://ratatoskr.run/git/2021/09/7902645/t.md

```text
Carlo Marcelo Arenas Belón  [ref] writes:

> b8ba412bf7 (tree-diff: avoid alloca for large allocations, 2016-06-07)
> adds a way to route some bigger allocations out of the stack and free
> them through the addition of two conveniently named macros, but leaves
> the calls to free the xalloca part, which could be also in the heap,
> if the system doesn't HAVE_ALLOCA (ex: macOS).

Nicely spotted and analyzed.  Thanks.
```
