diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-04-23 11:07:19 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-04-23 11:07:19 +0200 |
| commit | baf861a511a2c5cb091fcaa510c1b66331c49bed (patch) | |
| tree | f681e5d2b8ab898b53ce76610cbbc6c684e821e0 /src | |
| parent | c1aefb35dd39efa0045a9925520b4715f82433e3 (diff) | |
| download | libgit2-baf861a511a2c5cb091fcaa510c1b66331c49bed.tar.gz | |
Fix git_repository_set_odb() refcount issue
git_repository_free() calls git_odb_free() if the owned odb is not null.
According to the doc, when setting a new odb through git_repository_set_odb() the caller has to take care of releasing the odb by himself.
Diffstat (limited to 'src')
| -rw-r--r-- | src/repository.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/repository.c b/src/repository.c index 41a176a81..c8b6ae4f2 100644 --- a/src/repository.c +++ b/src/repository.c @@ -549,6 +549,7 @@ void git_repository_set_odb(git_repository *repo, git_odb *odb) repo->_odb = odb; GIT_REFCOUNT_OWN(repo->_odb, repo); + GIT_REFCOUNT_INC(odb); } int git_repository_index__weakptr(git_index **out, git_repository *repo) |
