Skip to content

Commit

Permalink
Merge pull request #3441 from nspcc-dev/boltdb-clone
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov committed May 16, 2024
2 parents 31a99d4 + 502f024 commit 0b69901
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/core/storage/boltdb_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,8 @@ func NewBoltDBStore(cfg dbconfig.BoltDBOptions) (*BoltDBStore, error) {
func (s *BoltDBStore) Get(key []byte) (val []byte, err error) {
err = s.db.View(func(tx *bbolt.Tx) error {
b := tx.Bucket(Bucket)
val = b.Get(key)
// Value from Get is only valid for the lifetime of transaction, #1482
if val != nil {
val = bytes.Clone(val)
}
val = bytes.Clone(b.Get(key))
return nil
})
if val == nil {
Expand Down

0 comments on commit 0b69901

Please sign in to comment.