grep: Fix two memory leaks
PATCH 2/3 grep: Fix two memory leaks
We duplicate the grep_opt structure when using grep threads, but didn't later free either the patterns attached to this new structure or the structure itself.
Signed-off-by Dan McGee <[email protected]>
---
Found these with valgrind.
-Dan
builtin-grep.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
builtin-grep.c +2 -0
@@ -205,6 +205,8 @@ static void *run(void *arg)work_done (w); } +free_grep_patterns (arg); +free (arg);return (void *) (intptr_t ) hit; }
Signature · 1 line
1.6.6.1
Quoted 7 lines · Dan McGee
We duplicate the
grep_optstructure when using grep threads, but didn't later free either the patterns attached to this new structure or the structure itself.Signed-off-by Dan McGee <[email protected]>---
Found these with valgrind.
Ignore the misleading numbers in the subject, there isn't more to see here...whoops.
-Dan