summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-20 04:37:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-20 04:37:21 (GMT)
commitdf3b1192650c6753932a0897c4608fcc22ca8d47 (patch)
tree25617fa7ac42ab4b05f5064a4c8f97ef63e5235e /builtin/grep.c
parenteb3af74e93953df7917dca43d264ac8d1fb85671 (diff)
parent7861fa07c38d72a4fa6ae2e802553b8b0f3731d4 (diff)
downloadgit-df3b1192650c6753932a0897c4608fcc22ca8d47.zip
git-df3b1192650c6753932a0897c4608fcc22ca8d47.tar.gz
git-df3b1192650c6753932a0897c4608fcc22ca8d47.tar.bz2
Merge branch 'ab/grep-plug-pathspec-leak'
Call clear_pathspec() to release resources immediately before the cmd_grep() function returns. * ab/grep-plug-pathspec-leak: grep: plug a trivial memory leak
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 65070c5..3ffb5b4 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1299,6 +1299,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
hit |= wait_all();
if (hit && show_in_pager)
run_pager(&opt, prefix);
+ clear_pathspec(&pathspec);
free_grep_patterns(&opt);
return !hit;
}