mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-15 14:19:43 +00:00
tests: fix memory leaks in checkout::typechange
This commit is contained in:
parent
246d25b3ce
commit
6e0d473bee
@ -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);
|
git_futils_rmdir_r(git_buf_cstr(&submodulepath), NULL, GIT_RMDIR_REMOVE_FILES);
|
||||||
|
|
||||||
/* initialize submodule and its repository */
|
/* initialize submodule's repository */
|
||||||
cl_git_pass(git_submodule_init(sm, 1));
|
|
||||||
cl_git_pass(git_submodule_repo_init(&submodule_repo, sm, 0));
|
cl_git_pass(git_submodule_repo_init(&submodule_repo, sm, 0));
|
||||||
|
|
||||||
/* create a file in the submodule workdir to make it dirty */
|
/* 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(&dirtypath);
|
||||||
git_buf_free(&submodulepath);
|
git_buf_free(&submodulepath);
|
||||||
|
git_repository_free(submodule_repo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user