mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-25 08:50:25 +00:00
index, iterator, fetchhead: plug leaks
This commit is contained in:
parent
afd8a94ee7
commit
24fa21f38e
@ -1926,6 +1926,9 @@ int git_iterator_walk(
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
git__free(iterator_item);
|
||||||
|
git__free(cur_items);
|
||||||
|
|
||||||
if (error == GIT_ITEROVER)
|
if (error == GIT_ITEROVER)
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
|
@ -394,4 +394,7 @@ void test_fetchhead_nonetwork__create_when_refpecs_given(void)
|
|||||||
cl_git_pass(git_repository_fetchhead_foreach(g_repo, find_master, NULL));
|
cl_git_pass(git_repository_fetchhead_foreach(g_repo, find_master, NULL));
|
||||||
cl_assert(find_master_called);
|
cl_assert(find_master_called);
|
||||||
cl_assert(found_master);
|
cl_assert(found_master);
|
||||||
|
|
||||||
|
git_remote_free(remote);
|
||||||
|
git_buf_free(&path);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ void test_index_racy__empty_file_after_smudge(void)
|
|||||||
const git_index_entry *entry;
|
const git_index_entry *entry;
|
||||||
|
|
||||||
/* Make sure we do have a timestamp */
|
/* Make sure we do have a timestamp */
|
||||||
cl_git_pass(git_repository_index(&index, g_repo));
|
cl_git_pass(git_repository_index__weakptr(&index, g_repo));
|
||||||
cl_git_pass(git_index_write(index));
|
cl_git_pass(git_index_write(index));
|
||||||
|
|
||||||
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A"));
|
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A"));
|
||||||
@ -140,4 +140,7 @@ void test_index_racy__empty_file_after_smudge(void)
|
|||||||
|
|
||||||
cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL));
|
cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL));
|
||||||
cl_assert_equal_i(1, git_diff_num_deltas(diff));
|
cl_assert_equal_i(1, git_diff_num_deltas(diff));
|
||||||
|
|
||||||
|
git_buf_free(&path);
|
||||||
|
git_diff_free(diff);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user