From cdac5076cb7adecdf626772e9222f56a3ff1936e Mon Sep 17 00:00:00 2001 From: Yori Mihalakopoulos Date: Wed, 7 Nov 2018 20:01:10 +1100 Subject: [PATCH] Free the branch iterator --- ObjectiveGit/GTRepository.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ObjectiveGit/GTRepository.m b/ObjectiveGit/GTRepository.m index cd4fce6b8..dde113c2c 100644 --- a/ObjectiveGit/GTRepository.m +++ b/ObjectiveGit/GTRepository.m @@ -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) {