Fix memory leaks in NewIndex() and OpenIndex()

This commit is contained in:
FUJII Ryota 2015-10-27 15:20:50 +09:00
parent 3b5633de21
commit ae107d5f56
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