summaryrefslogtreecommitdiff
path: root/index.go
diff options
context:
space:
mode:
authorFUJII Ryota <[email protected]>2015-10-27 15:20:50 +0900
committerFUJII Ryota <[email protected]>2015-10-27 15:20:50 +0900
commitae107d5f56a0cb2b9703ad3733143e0f6acc01de (patch)
tree8aeba78b879631a0aa48d3ca8939cf7dd1346636 /index.go
parent3b5633de219eec2908723a8e557758cc055d84d1 (diff)
Fix memory leaks in NewIndex() and OpenIndex()
Diffstat (limited to 'index.go')
-rw-r--r--index.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.go b/index.go
index 0174dc1..1eb5e9d 100644
--- a/index.go
+++ b/index.go
@@ -97,7 +97,7 @@ func NewIndex() (*Index, error) {
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
@@ -115,7 +115,7 @@ func OpenIndex(path string) (*Index, error) {
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