mirror of
https://git.proxmox.com/git/libgit2
synced 2026-08-26 20:08:02 +00:00
Plug leaks
Valgrind is now clean except for libssl and libgcrypt.
This commit is contained in:
@@ -12,12 +12,9 @@ git_tree *resolve_commit_oid_to_tree(
|
||||
git_tree *tree = NULL;
|
||||
|
||||
if (git_oid_fromstrn(&oid, partial_oid, len) == 0)
|
||||
git_object_lookup_prefix(&obj, repo, &oid, len, GIT_OBJ_ANY);
|
||||
cl_assert(obj);
|
||||
if (git_object_type(obj) == GIT_OBJ_TREE)
|
||||
return (git_tree *)obj;
|
||||
cl_assert(git_object_type(obj) == GIT_OBJ_COMMIT);
|
||||
cl_git_pass(git_commit_tree(&tree, (git_commit *)obj));
|
||||
cl_git_pass(git_object_lookup_prefix(&obj, repo, &oid, len, GIT_OBJ_ANY));
|
||||
|
||||
cl_git_pass(git_object_peel((git_object **) &tree, obj, GIT_OBJ_TREE));
|
||||
git_object_free(obj);
|
||||
return tree;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user