Commit c332464
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent eed1fbe commit c332464
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
593 | 592 | | |
594 | 593 | | |
595 | 594 | | |
| |||
0 commit comments