Skip to content

Commit

Permalink
fix: segfault on node restart (#3736)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimjbrettj committed Feb 2, 2024
1 parent 12234de commit d1ca7aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/database/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ func (p *PebbleDB) Get(key []byte) (value []byte, err error) {
return nil, err
}

valueCpy := make([]byte, len(value))
copy(valueCpy, value)

if err := closer.Close(); err != nil {
return nil, fmt.Errorf("closing after get: %w", err)
}

valueCpy := make([]byte, len(value))
copy(valueCpy, value)
return valueCpy, err
}

Expand Down

0 comments on commit d1ca7aa

Please sign in to comment.