aboutsummaryrefslogtreecommitdiff
path: root/builtin-grep.c
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2010-01-30 09:42:58 -0600
committerJunio C Hamano <gitster@pobox.com>2010-01-30 09:11:00 -0800
commitbfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb (patch)
tree3143071c046a80676110fad40cdcfaadc3e36706 /builtin-grep.c
parent31d87385c4fbd7fc4ab295f2848531b5c1021828 (diff)
downloadgit-bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb.tar.gz
git-bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb.tar.xz
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 <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c2
1 files changed, 2 insertions, 0 deletions
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;
}