libgit2/libgit2 — pull request #1165 by scunz (2012-12-19 07:19:16+00:00)
Title: Fix a leak in iterator code

The `git_diff__from_iterators` sometimes wraps the given iterators into case insensitively sorted ones. These wrapping iterators would free the wrapped iterators.
However, the call-site, the `DIFF_FROM_ITERATORS` macro doesn't know anything about the wrapping iterators, so it can just free the ones it had setup itself.

@arrbee Maybe you could find a nicer way to do this (Like not freeing the wrappee from the wrapper, but rather do it directly in `git_diff__from_iterators`). The `git_iterator**` that this patch uses looks odd somehow.