diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2010-12-09 20:55:54 +0100 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2010-12-10 04:45:20 +0200 |
| commit | 6c14d641234d74dcc8a9e09ce1a6d461b3c193e9 (patch) | |
| tree | f10baf0311106c01d687d202dd28cfc181e908e8 /src | |
| parent | 9de351b2581f41ee049326ddbfb7deddd3710561 (diff) | |
| download | libgit2-6c14d641234d74dcc8a9e09ce1a6d461b3c193e9.tar.gz | |
Fixed a memory leak in git_repository_lookup() when provided git_otype is invalid.
Diffstat (limited to 'src')
| -rw-r--r-- | src/repository.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/repository.c b/src/repository.c index b28c4ac9b..f27f77cb3 100644 --- a/src/repository.c +++ b/src/repository.c @@ -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; |
