diff options
| author | Elijah Newren <newren@gmail.com> | 2026-08-29 07:00:29 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-08-30 13:37:42 -0700 |
| commit | 6272f3bd174fcd1b394d8b5e05b2ba384bd9f63e (patch) | |
| tree | caa87060de7f4a6377ae5f5895540529e24bd636 /contrib/persistent-https | |
| parent | b6f5e80fdf32c270ff812c1743e720dedca7d5e2 (diff) | |
mktree: plug per-tree leak in --batch mode
In --batch mode "git mktree" reuses its entry buffer across trees,
resetting `used` to 0 after writing each tree. It never frees the
`treeent` structures the previous tree appended, though, so once the
next tree overwrites those slots the earlier allocations are leaked. A
single-tree invocation hides this, as the entries stay reachable through
the `entries` global until exit.
Free each entry when resetting the buffer, and free the buffer itself
before returning.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions
