Commit a5123ea80b4a2a561863e69bf15a5d73243b3eb6

Vicent Marti 2011-11-28T20:00:42

repository: Do not double-increment refcounts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/repository.c b/src/repository.c
index f1a37c9..0cd4a81 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -312,7 +312,6 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo)
 		GIT_REFCOUNT_OWN(repo->_odb, repo);
 	}
 
-	GIT_REFCOUNT_INC(repo->_odb);
 	*out = repo->_odb;
 	return GIT_SUCCESS;
 }
@@ -358,7 +357,6 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
 		GIT_REFCOUNT_OWN(repo->_index, repo);
 	}
 
-	GIT_REFCOUNT_INC(repo->_index);
 	*out = repo->_index;
 	return GIT_SUCCESS;
 }