Skip to content

Commit df3b119

Browse files
committed
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
2 parents eb3af74 + 7861fa0 commit df3b119

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/grep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
12991299
hit |= wait_all();
13001300
if (hit && show_in_pager)
13011301
run_pager(&opt, prefix);
1302+
clear_pathspec(&pathspec);
13021303
free_grep_patterns(&opt);
13031304
return !hit;
13041305
}

0 commit comments

Comments
 (0)