revisions API users: use release_revisions() needing REV_INFO_INIT
Use release_revisions() to various users of "struct rev_list" which need to have their "struct rev_info" zero-initialized before we can start using it. For the bundle.c code see the early exit case added in3bbbe467f2(bundle verify: error out if called without an object database, 2019-05-27). For the relevant bisect.c code see45b6370812(bisect: libify `check_good_are_ancestors_of_bad` and its dependents, 2020-02-17). For the submodule.c code see the "goto" on "(!left || !right || !sub)" added in8e6df65015(submodule: refactor show_submodule_summary with helper function, 2016-08-31). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
296a143845
commit
f196c1e908
@ -766,7 +766,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
|
||||
{
|
||||
char *displaypath;
|
||||
struct strvec diff_files_args = STRVEC_INIT;
|
||||
struct rev_info rev;
|
||||
struct rev_info rev = REV_INFO_INIT;
|
||||
int diff_files_result;
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
const char *git_dir;
|
||||
@ -853,6 +853,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
|
||||
cleanup:
|
||||
strvec_clear(&diff_files_args);
|
||||
free(displaypath);
|
||||
release_revisions(&rev);
|
||||
}
|
||||
|
||||
static void status_submodule_cb(const struct cache_entry *list_item,
|
||||
|
||||
Reference in New Issue
Block a user