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 authored and timwu20 committed Apr 19, 2024
1 parent d16301f commit 01cd75a
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 01cd75a

Please sign in to comment.