summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2010-01-30 15:42:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-30 17:11:00 (GMT)
commitbfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb (patch)
tree3143071c046a80676110fad40cdcfaadc3e36706
parent31d87385c4fbd7fc4ab295f2848531b5c1021828 (diff)
downloadgit-bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb.zip
git-bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb.tar.gz
git-bfac23d9534ea88ed2b033cf0cb17b22ec0e4cdb.tar.bz2
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>
-rw-r--r--builtin-grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 9bd467c..0ef849c 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;
}