Skip to content

Commit

Permalink
Merge pull request #680 from yori/fix-branch-iterator-leak
Browse files Browse the repository at this point in the history
Free the branch iterator
  • Loading branch information
tiennou authored Nov 7, 2018
2 parents fb31e47 + cdac507 commit 8927e23
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ObjectiveGit/GTRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ - (BOOL)enumerateBranchesWithType:(GTBranchType)type error:(NSError **)error usi
if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
return NO;
}

@onExit {
git_branch_iterator_free(iter);
};

git_branch_t branchType;
while ((gitError = git_branch_next(&gitRef, &branchType, iter)) == GIT_OK) {
Expand Down

0 comments on commit 8927e23

Please sign in to comment.