Skip to content

Commit

Permalink
controller: Free remaining libgit2 objects
Browse files Browse the repository at this point in the history
This supersedes #238.

Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Oct 28, 2021
1 parent c4b8b42 commit b29b87a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/imageupdateautomation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,12 @@ func fetch(ctx context.Context, path string, branch string, access repoAccess) e
if err != nil {
return err
}
defer repo.Free()
origin, err := repo.Remotes.Lookup(originRemote)
if err != nil {
return err
}
defer origin.Free()
err = origin.Fetch(
[]string{refspec},
&libgit2.FetchOptions{
Expand All @@ -653,10 +655,12 @@ func push(ctx context.Context, path, branch string, access repoAccess) error {
if err != nil {
return err
}
defer repo.Free()
origin, err := repo.Remotes.Lookup(originRemote)
if err != nil {
return err
}
defer origin.Free()

callbacks := access.remoteCallbacks()

Expand Down

0 comments on commit b29b87a

Please sign in to comment.