Skip to content

Commit cdac507

Browse files
committed
Free the branch iterator
1 parent fb31e47 commit cdac507

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ObjectiveGit/GTRepository.m

+4
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ - (BOOL)enumerateBranchesWithType:(GTBranchType)type error:(NSError **)error usi
407407
if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
408408
return NO;
409409
}
410+
411+
@onExit {
412+
git_branch_iterator_free(iter);
413+
};
410414

411415
git_branch_t branchType;
412416
while ((gitError = git_branch_next(&gitRef, &branchType, iter)) == GIT_OK) {

0 commit comments

Comments
 (0)