Given the `git_remote_delete()` implementation, I think your code construct is better.

if res < 0, we'll throw and the handle will be freed by the surrounding using statement.

I think git_branch_delete() should be fixed and follow the same pattern if the call to free() is the last line in libgit2 code.