Skip to content

Commit

Permalink
Merge pull request #90 from flynn/fix-bolt-values
Browse files Browse the repository at this point in the history
Ensure we copy boltdb values
  • Loading branch information
titanous committed Dec 1, 2015
2 parents 55659a6 + 79f965c commit 69ec51c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/local_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ func (f *fileLocalStore) GetMeta() (map[string]json.RawMessage, error) {
if err := f.db.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte(dbBucket))
b.ForEach(func(k, v []byte) error {
meta[string(k)] = v
vcopy := make([]byte, len(v))
copy(vcopy, v)
meta[string(k)] = vcopy
return nil
})
return nil
Expand Down

0 comments on commit 69ec51c

Please sign in to comment.