Skip to content

Commit

Permalink
unslab header buffers also
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jul 26, 2024
1 parent b45bfec commit 4334e3e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ module.exports = class Core {
header = await bigHeader.load(header.external)
}

// unslab the long lived buffers to avoid keeping the slab alive
if (header.key !== null) header.key = unslab(header.key)
if (header.tree.rootHash !== null) header.tree.rootHash = unslab(header.tree.rootHash)
if (header.tree.signature !== null) header.tree.signature = unslab(header.tree.signature)

if (opts.manifest) {
// if we provide a manifest and no key, verify that the stored key is the same
if (!opts.key && !Verifier.isValidManifest(header.key, Verifier.createManifest(opts.manifest))) {
Expand Down

0 comments on commit 4334e3e

Please sign in to comment.