mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 16:22:40 +00:00
Fix some memory leaks
This commit is contained in:
parent
596b121ae4
commit
2f77d8f15d
@ -2030,6 +2030,8 @@ int git_index_read_tree(git_index *index, const git_tree *tree)
|
|||||||
error = git_tree_walk(tree, GIT_TREEWALK_POST, read_tree_cb, &data);
|
error = git_tree_walk(tree, GIT_TREEWALK_POST, read_tree_cb, &data);
|
||||||
|
|
||||||
index_entries_free(&entries);
|
index_entries_free(&entries);
|
||||||
|
git_vector_free(&entries);
|
||||||
|
|
||||||
git_vector_sort(&index->entries);
|
git_vector_sort(&index->entries);
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
@ -1267,8 +1267,10 @@ static int rename_remote_references(
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
while ((error = git_reference_next(&ref, iter)) == 0) {
|
while ((error = git_reference_next(&ref, iter)) == 0) {
|
||||||
if (git__prefixcmp(ref->name, GIT_REFS_REMOTES_DIR))
|
if (git__prefixcmp(ref->name, GIT_REFS_REMOTES_DIR)) {
|
||||||
|
git_reference_free(ref);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((error = rename_one_remote_reference(ref, old_name, new_name)) < 0) {
|
if ((error = rename_one_remote_reference(ref, old_name, new_name)) < 0) {
|
||||||
git_reference_iterator_free(iter);
|
git_reference_iterator_free(iter);
|
||||||
|
Loading…
Reference in New Issue
Block a user