summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-04-19 21:37:21 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-04-19 21:37:21 -0700
commitdf3b1192650c6753932a0897c4608fcc22ca8d47 (patch)
tree25617fa7ac42ab4b05f5064a4c8f97ef63e5235e /builtin
parentMerge branch 'jk/no-looking-at-dotgit-outside-repo' (diff)
parentgrep: plug a trivial memory leak (diff)
downloadtgif-df3b1192650c6753932a0897c4608fcc22ca8d47.tar.xz
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')
-rw-r--r--builtin/grep.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 65070c52fc..3ffb5b4e81 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;
}