summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-06-07 12:29:16 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2016-10-01 17:40:37 +0200
commit6e0d473bee5f7dcc142c7d2542d24e5a402611fa (patch)
tree29a42cc0dac84b9f041d70c8e640483c1db2244d
parent246d25b3ce218d2d300f60e75528c2fbe83f8db5 (diff)
downloadlibgit2-6e0d473bee5f7dcc142c7d2542d24e5a402611fa.tar.gz
tests: fix memory leaks in checkout::typechange
-rw-r--r--tests/checkout/typechange.c4
1 files 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;
}