Commit dae8ba6e by Russell Belfer

Fix memory leak of test repository object

parent acdc7cff
...@@ -449,7 +449,6 @@ void test_diff_submodules__skips_empty_includes_used(void) ...@@ -449,7 +449,6 @@ void test_diff_submodules__skips_empty_includes_used(void)
git_diff_options opts = GIT_DIFF_OPTIONS_INIT; git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
git_diff *diff = NULL; git_diff *diff = NULL;
diff_expects exp; diff_expects exp;
git_repository *r2;
/* A side effect of of Git's handling of untracked directories and /* A side effect of of Git's handling of untracked directories and
* auto-ignoring of ".git" entries is that a newly initialized Git * auto-ignoring of ".git" entries is that a newly initialized Git
...@@ -469,7 +468,11 @@ void test_diff_submodules__skips_empty_includes_used(void) ...@@ -469,7 +468,11 @@ void test_diff_submodules__skips_empty_includes_used(void)
cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.files);
git_diff_free(diff); git_diff_free(diff);
cl_git_pass(git_repository_init(&r2, "empty_standard_repo/subrepo", 0)); {
git_repository *r2;
cl_git_pass(git_repository_init(&r2, "empty_standard_repo/subrepo", 0));
git_repository_free(r2);
}
cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts));
memset(&exp, 0, sizeof(exp)); memset(&exp, 0, sizeof(exp));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment