diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-09-30 11:13:24 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-30 11:23:03 -0700 |
| commit | 666643fa89e4386c0f4eabd1112e8b3af0cb9cc1 (patch) | |
| tree | 4bae05b501fa4eed53e7641520a2cef439923e1d /diffcore-rotate.c | |
| parent | shell: fix leaking strings (diff) | |
| download | git-666643fa89e4386c0f4eabd1112e8b3af0cb9cc1.tar.gz git-666643fa89e4386c0f4eabd1112e8b3af0cb9cc1.zip | |
wt-status: fix leaking buffer with sparse directories
When hitting a sparse directory in `wt_status_collect_changes_initial()`
we use a `struct strbuf` to assemble the directory's name. We never free
that buffer though, causing a memory leak.
Fix the leak by releasing the buffer. While at it, move the buffer
outside of the loop and reset it to save on some wasteful allocations.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-rotate.c')
0 files changed, 0 insertions, 0 deletions
