From bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 30 Jan 2010 09:42:58 -0600 Subject: [PATCH] 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 --- builtin-grep.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.30.2