From: Dan McGee Date: Sat, 30 Jan 2010 15:42:58 +0000 (-0600) Subject: grep: Fix two memory leaks X-Git-Tag: v1.7.0-rc1~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-grep.c b/builtin-grep.c index 9bd467c9b..0ef849cb8 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -205,6 +205,8 @@ static void *run(void *arg) work_done(w); } + free_grep_patterns(arg); + free(arg); return (void*) (intptr_t) hit; }