Skip to content

Commit 96c1012

Browse files
avargitster
authored andcommitted
grep: use object_array_clear() in cmd_grep()
Free the "struct object_array" before exiting. This makes grep tests (e.g. "t7815-grep-binary.sh") a bit happer under SANITIZE=leak. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2fb767 commit 96c1012

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
@@ -1196,6 +1196,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
11961196
run_pager(&opt, prefix);
11971197
clear_pathspec(&pathspec);
11981198
free_grep_patterns(&opt);
1199+
object_array_clear(&list);
11991200
free_repos();
12001201
return !hit;
12011202
}

0 commit comments

Comments
 (0)