summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-10-26 00:11:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-10-26 00:11:37 (GMT)
commit3ae0094a91822556635520c1a1378f551a246d55 (patch)
tree01d977ee973020bb35d1a83f1dc52da5a49cee7c
parent1155c8efbb152ecb5fb9e1414245f4ab637f37ab (diff)
parent246526d019e0edf2ad804a182cae865ff5717cf7 (diff)
downloadgit-3ae0094a91822556635520c1a1378f551a246d55.zip
git-3ae0094a91822556635520c1a1378f551a246d55.tar.gz
git-3ae0094a91822556635520c1a1378f551a246d55.tar.bz2
Merge branch 'rs/bisect-start-leakfix' into maint-2.38
Code clean-up that results in plugging a leak. * rs/bisect-start-leakfix: bisect--helper: plug strvec leak
-rw-r--r--builtin/bisect--helper.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index 501245f..28ef7ec 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -765,11 +765,10 @@ static enum bisect_error bisect_start(struct bisect_terms *terms, const char **a
strbuf_read_file(&start_head, git_path_bisect_start(), 0);
strbuf_trim(&start_head);
if (!no_checkout) {
- struct strvec argv = STRVEC_INIT;
+ const char *argv[] = { "checkout", start_head.buf,
+ "--", NULL };
- strvec_pushl(&argv, "checkout", start_head.buf,
- "--", NULL);
- if (run_command_v_opt(argv.v, RUN_GIT_CMD)) {
+ if (run_command_v_opt(argv, RUN_GIT_CMD)) {
res = error(_("checking out '%s' failed."
" Try 'git bisect start "
"<valid-branch>'."),