summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-26 13:46:24 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-27 08:25:35 -0700
commit04ff8008f3a27274e53c69209362a5bbe3dc4457 (patch)
tree2c8f0c1f72d9653c5d42f8a5dc6dc3eba7805487 /builtin/commit.c
parent5bf922a4e914f15d899d38218ad0591933025ed4 (diff)
dir: fix off by one errors for ignored and untracked entries
In `treat_directory()` we perform some logic to handle ignored and untracked entries. When populating a directory with entries we first save the current number of ignored/untracked entries and then populate new entries at the end of our arrays that keep track of those entries. When we figure out that all entries have been ignored/are untracked we then remove this tail of entries from those vectors again. But there is an off by one error in both paths that causes us to not free the first ignored and untracked entries, respectively. Fix these off-by-one errors to plug the resulting leak. While at it, massage the code a bit to match our modern code style. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions