Skip to content

Commit 292c602

Browse files
committed
tests: fix memory leaks in checkout::typechange
1 parent f0ee795 commit 292c602

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/checkout/typechange.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ static int make_submodule_dirty(git_submodule *sm, const char *name, void *paylo
240240
));
241241
git_futils_rmdir_r(git_buf_cstr(&submodulepath), NULL, GIT_RMDIR_REMOVE_FILES);
242242

243-
/* initialize submodule and its repository */
244-
cl_git_pass(git_submodule_init(sm, 1));
243+
/* initialize submodule's repository */
245244
cl_git_pass(git_submodule_repo_init(&submodule_repo, sm, 0));
246245

247246
/* 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
251250

252251
git_buf_free(&dirtypath);
253252
git_buf_free(&submodulepath);
253+
git_repository_free(submodule_repo);
254254

255255
return 0;
256256
}

0 commit comments

Comments
 (0)