Skip to content

Commit

Permalink
grep: Fix two memory leaks
Browse files Browse the repository at this point in the history
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 <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Dan McGee authored and Junio C Hamano committed Jan 30, 2010
1 parent 31d8738 commit bfac23d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin-grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ static void *run(void *arg)

work_done(w);
}
free_grep_patterns(arg);
free(arg);

return (void*) (intptr_t) hit;
}
Expand Down

0 comments on commit bfac23d

Please sign in to comment.