mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 04:20:01 +00:00
Fixed a memory leak in git_repository_lookup() when provided git_otype is invalid.
This commit is contained in:
parent
9de351b258
commit
6c14d64123
@ -620,8 +620,10 @@ int git_repository_lookup(git_object **object_out, git_repository *repo, const g
|
|||||||
if (error < GIT_SUCCESS)
|
if (error < GIT_SUCCESS)
|
||||||
return error;
|
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;
|
return GIT_EINVALIDTYPE;
|
||||||
|
}
|
||||||
|
|
||||||
type = obj_file.type;
|
type = obj_file.type;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user