libgit2/libgit2 — pull request #1673 by arthurschreiber (2013-06-24 19:04:21+00:00)
Title: Memory leak in `git_remote_connect`

While fixing some memory leaks in Rugged, I think I found a memory leak in libgit2 itself!

The following rugged code does not leak:

```ruby
repo = Rugged::Repository.new(".")

10000000.times do
remote = Rugged::Remote.lookup(repo, 'origin')
remote.connect(:push)
remote.disconnect
end
```

This leaks like crazy:

```ruby
repo = Rugged::Repository.new(".")
remote = Rugged::Remote.lookup(repo, 'origin')

10000000.times do
remote.connect(:push)
remote.disconnect
end
```

`#connect` and `#disconnect` simply forward to their libgit2 counterparts, I'm very sure the leak does not come from issues in Rugged itself.

/cc @arrbee