From: Junio C Hamano Date: Thu, 21 Jul 2022 21:51:56 GMT Subject: Re: [PATCH v3 26/26] submodule--helper: fix a configure_added_submodule() leak Message-ID: In-Reply-To: Ævar Arnfjörð Bjarmason writes: > static void configure_added_submodule(struct add_data *add_data) > { > char *key; > - char *val = NULL; > + const char *val; > struct child_process add_submod = CHILD_PROCESS_INIT; > struct child_process add_gitmodules = CHILD_PROCESS_INIT; > > @@ -3306,7 +3306,7 @@ static void configure_added_submodule(struct add_data *add_data) > * is_submodule_active(), since that function needs to find > * out the value of "submodule.active" again anyway. > */ > - if (!git_config_get_string("submodule.active", &val)) { > + if (!git_config_get_string_tmp("submodule.active", &val)) { Obviously correct ;-)