Commit ec83061
grep: stop leaking line strings with -f
When reading patterns from a file, we pass the lines as allocated string
buffers to append_grep_pat() and never free them. That's not a problem
because they are needed until the program ends anyway.
However, now that the function duplicates the pattern string, we can
reuse the strbuf after calling that function. This simplifies the code
a bit and plugs a minor memory leak.
Signed-off-by: Rene Scharfe <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 526a858 commit ec83061
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | 684 | | |
688 | 685 | | |
689 | 686 | | |
690 | 687 | | |
691 | | - | |
692 | | - | |
| 688 | + | |
| 689 | + | |
693 | 690 | | |
694 | 691 | | |
695 | 692 | | |
| |||
0 commit comments