Merge pull request #268 from clearr/fix-index-leaks

Fix memory leaks in NewIndex() and OpenIndex()
This commit is contained in:
Carlos Martín Nieto 2015-10-29 13:04:01 +01:00
commit c646a2eb30
1 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ func NewIndex() (*Index, error) {
return nil, MakeGitError(err) return nil, MakeGitError(err)
} }
return &Index{ptr: ptr}, nil return newIndexFromC(ptr), nil
} }
// OpenIndex creates a new index at the given path. If the file does // OpenIndex creates a new index at the given path. If the file does
@ -115,7 +115,7 @@ func OpenIndex(path string) (*Index, error) {
return nil, MakeGitError(err) return nil, MakeGitError(err)
} }
return &Index{ptr: ptr}, nil return newIndexFromC(ptr), nil
} }
// Path returns the index' path on disk or an empty string if it // Path returns the index' path on disk or an empty string if it