Skip to content

Commit

Permalink
fix memory leak of repo object in getReferences
Browse files Browse the repository at this point in the history
  • Loading branch information
zawata committed Apr 12, 2024
1 parent e132dca commit c024dfb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generate/templates/manual/repository/get_remotes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ void GitRepository::GetRemotesWorker::Execute()
if (giterr_last() != NULL) {
baton->error = git_error_dup(giterr_last());
}

git_repository_free(repo);
delete baton->out;
baton->out = NULL;
return;
Expand Down Expand Up @@ -82,6 +84,9 @@ void GitRepository::GetRemotesWorker::Execute()

baton->out->push_back(remote);
}

git_strarray_free(&remote_names);
git_repository_free(repo);
}

void GitRepository::GetRemotesWorker::HandleErrorCallback() {
Expand Down

0 comments on commit c024dfb

Please sign in to comment.