From 292c60275e98c15fcbbc295b44c306d7b2ecb6af Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 7 Jun 2016 12:29:16 +0200 Subject: [PATCH] tests: fix memory leaks in checkout::typechange --- tests/checkout/typechange.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkout/typechange.c b/tests/checkout/typechange.c index 1efea931a..8a5110caa 100644 --- a/tests/checkout/typechange.c +++ b/tests/checkout/typechange.c @@ -240,8 +240,7 @@ static int make_submodule_dirty(git_submodule *sm, const char *name, void *paylo )); git_futils_rmdir_r(git_buf_cstr(&submodulepath), NULL, GIT_RMDIR_REMOVE_FILES); - /* initialize submodule and its repository */ - cl_git_pass(git_submodule_init(sm, 1)); + /* initialize submodule's repository */ cl_git_pass(git_submodule_repo_init(&submodule_repo, sm, 0)); /* create a file in the submodule workdir to make it dirty */ @@ -251,6 +250,7 @@ static int make_submodule_dirty(git_submodule *sm, const char *name, void *paylo git_buf_free(&dirtypath); git_buf_free(&submodulepath); + git_repository_free(submodule_repo); return 0; } -- 2.39.5