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
This commit is contained in:
Junio C Hamano 2017-04-19 21:37:21 -07:00
commit df3b119265

View File

@ -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;
}