diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-22 10:55:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-23 10:45:25 -0700 |
commit | 96c101257b00b73f0185fc6630160a5f0b5d4277 (patch) | |
tree | dd49d51a7a5969480c1a1de6919076334b403a76 | |
parent | grep: prefer "struct grep_opt" over its "void *" equivalent (diff) | |
download | tgif-96c101257b00b73f0185fc6630160a5f0b5d4277.tar.xz |
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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin/grep.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index fd184c182a..555b2ab600 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1196,6 +1196,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix) run_pager(&opt, prefix); clear_pathspec(&pathspec); free_grep_patterns(&opt); + object_array_clear(&list); free_repos(); return !hit; } |