From: Junio C Hamano Date: Tue, 24 Mar 2026 13:45:48 GMT Subject: Re: [PATCH v2 2/2] rev-parse: use selected alternate terms too look up refs Message-ID: <87fr5pjq7n.fsf@gitster.g> In-Reply-To: <20260323-bisect-terms-v2-2-8d6bdb2c9c7e@schlaraffenlan.de> Jonas Rebmann writes: > #include "abspath.h" > +#include "bisect.h" > #include "config.h" > #include "commit.h" > #include "environment.h" > @@ -940,11 +941,14 @@ int cmd_rev_parse(int argc, > continue; > } > if (!strcmp(arg, "--bisect")) { > + char *term_bad = NULL; > + char *term_good = NULL; > struct refs_for_each_ref_options opts = { 0 }; > - opts.prefix = "refs/bisect/bad"; > + read_bisect_terms(&term_bad, &term_good); > + opts.prefix = xstrfmt("refs/bisect/%s", term_bad); > refs_for_each_ref_ext(get_main_ref_store(the_repository), > show_reference, NULL, &opts); > - opts.prefix = "refs/bisect/good"; > + opts.prefix = xstrfmt("refs/bisect/%s", term_good); > refs_for_each_ref_ext(get_main_ref_store(the_repository), > anti_reference, NULL, &opts); Aren't return values from two xstrfmt() calls leaking in this code? > continue;