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.
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)