Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
File history walk: memory management
  • Loading branch information
ianhattendorf committed May 20, 2019
commit 24cb2bfbb0f886ddfc022e6535756b7dc30a679e
8 changes: 5 additions & 3 deletions generate/templates/manual/revwalk/file_history_walk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ void GitRevwalk::FileHistoryWalkWorker::Execute()
}

delete fileHistoryEvent;
git_commit_free(parentCommit);
git_tree_free(parentTree);

if (firstMatchingParentIndex.first) {
git_commit_free(parentCommit);
git_tree_free(parentTree);
if (firstMatchingParentIndex.first) {
break;
}
}
Expand Down Expand Up @@ -414,6 +414,8 @@ void GitRevwalk::FileHistoryWalkWorker::Execute()
baton->out = NULL;
baton->error = git_error_dup(git_error_last());
}
free((void *)baton->file_path);
baton->file_path = NULL;
}

void GitRevwalk::FileHistoryWalkWorker::HandleOKCallback()
Expand Down