Commit acd1700630ea1159a55dc5e8cee12e4a725afe18

Carlos Martín Nieto 2012-10-07T11:19:19

remote: only keep a weak pointer in update_tips The reference is only needed inside the function. We mistakenly increased the reference counter causing the ODB not to get freed and leaking descriptors.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/remote.c b/src/remote.c
index c01e41d..b73af01 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -467,7 +467,7 @@ int git_remote_update_tips(git_remote *remote)
 	if (refs->length == 0)
 		return 0;
 
-	if (git_repository_odb(&odb, remote->repo) < 0)
+	if (git_repository_odb__weakptr(&odb, remote->repo) < 0)
 		return -1;
 
 	if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0)