mirror of
https://github.com/splitsh/lite.git
synced 2026-03-14 13:55:46 +01:00
fixed mem leak
This commit is contained in:
parent
260fd61355
commit
5aa5b5768b
1 changed files with 8 additions and 1 deletions
|
|
@ -398,7 +398,6 @@ func (s *state) copyOrSkip(rev *git.Commit, tree *git.Tree, newParents []*git.Oi
|
|||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
defer commit.Free()
|
||||
p = append(p, commit)
|
||||
}
|
||||
}
|
||||
|
|
@ -431,10 +430,18 @@ func (s *state) copyOrSkip(rev *git.Commit, tree *git.Tree, newParents []*git.Oi
|
|||
}
|
||||
|
||||
if nil != identical && copyCommit == false {
|
||||
for _, c := range p {
|
||||
c.Free()
|
||||
}
|
||||
return identical, false, nil
|
||||
}
|
||||
|
||||
commit, err := s.copyCommit(rev, tree, p)
|
||||
|
||||
for _, c := range p {
|
||||
c.Free()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue