summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/node_crypto_bio.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h
index 5c38f1baa..c4f292367 100644
--- a/src/node_crypto_bio.h
+++ b/src/node_crypto_bio.h
@@ -107,8 +107,10 @@ class NodeBIO {
~Buffer() {
delete[] data_;
- if (env_ != nullptr)
- env_->isolate()->AdjustAmountOfExternalAllocatedMemory(-len_);
+ if (env_ != nullptr) {
+ const int64_t len = static_cast<int64_t>(len_);
+ env_->isolate()->AdjustAmountOfExternalAllocatedMemory(-len);
+ }
}
Environment* env_;