Commit 6c14d641 by nulltoken Committed by Vicent Marti

Fixed a memory leak in git_repository_lookup() when provided git_otype is invalid.

parent 9de351b2
......@@ -620,8 +620,10 @@ int git_repository_lookup(git_object **object_out, git_repository *repo, const g
if (error < GIT_SUCCESS)
return error;
if (type != GIT_OBJ_ANY && type != obj_file.type)
if (type != GIT_OBJ_ANY && type != obj_file.type) {
git_rawobj_close(&obj_file);
return GIT_EINVALIDTYPE;
}
type = obj_file.type;
......
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