From: Johannes Schindelin via GitGitGadget Date: Wed, 15 Jun 2022 23:35:37 GMT Subject: [PATCH 03/11] submodule--helper: avoid memory leak in `update_submodule()` Message-ID: <877a45867ae368bf9e053caedcb6cf421e02344d.1655336146.git.gitgitgadget@gmail.com> In-Reply-To: From: Johannes Schindelin Reported by Coverity. Signed-off-by: Johannes Schindelin --- builtin/submodule--helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 5c77dfcffee..d7b8004b933 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2512,6 +2512,8 @@ static int update_submodule(struct update_data *update_data) next.recursive_prefix = get_submodule_displaypath(prefixed_path, update_data->prefix); + free(prefixed_path); + next.prefix = NULL; oidcpy(&next.oid, null_oid()); oidcpy(&next.suboid, null_oid()); -- gitgitgadget