diff options
| author | Jeff King <peff@peff.net> | 2024-06-04 06:13:25 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-06-05 09:51:42 -0700 |
| commit | c3324649ed5af972c9e91740b46a6e2a063050d4 (patch) | |
| tree | 65814ae833e9738054bf45f21aa993ab4da54199 /refs/files-backend.c | |
| parent | dir.c: always copy input to add_pattern() (diff) | |
| download | git-c3324649ed5af972c9e91740b46a6e2a063050d4.tar.gz git-c3324649ed5af972c9e91740b46a6e2a063050d4.zip | |
sparse-checkout: reuse --stdin buffer when reading patterns
When we read patterns from --stdin, we loop on strbuf_getline(), and
detach each line we read to pass into add_pattern(). This used to be
necessary because add_pattern() required that the pattern strings remain
valid while the pattern_list was in use. But it also created a leak,
since we didn't record the detached buffers anywhere else.
Now that add_pattern() has been modified to make its own copy of the
strings, we can stop detaching and fix the leak. This fixes 4 leaks
detected in t1091.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
0 files changed, 0 insertions, 0 deletions
