bisect--helper: plug strvec leak

The strvec "argv" is used to build a command for run_command_v_opt(), but never freed. Use a constant string array instead, which doesn't require any cleanup. Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Oct 7, 2022 at 17:08 UTC 246526d019e0edf2ad804a182cae865ff5717cf7
1 file changed +3 -4
builtin/bisect--helper.c
+3 -4
@@ -764,11 +764,10 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, const char **a
764 strbuf_read_file(&start_head, git_path_bisect_start(), 0);
765 strbuf_trim(&start_head);
766 if (!no_checkout) {
767 - struct strvec argv = STRVEC_INIT;
767 + const char *argv[] = { "checkout", start_head.buf,
768 + "--", NULL };
769
769 - strvec_pushl(&argv, "checkout", start_head.buf,
770 - "--", NULL);
771 - if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
770 + if (run_command_v_opt(argv, RUN_GIT_CMD)) {
771 res = error(_("checking out '%s' failed."
772 " Try 'git bisect start "
773 "<valid-branch>'."),