diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 082b400ef4e35c..25e2ed64fa5475 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -5245,7 +5245,18 @@ class PBKDF2Request : public AsyncWrap { } ~PBKDF2Request() override { - release(); + free(pass_); + pass_ = nullptr; + passlen_ = 0; + + free(salt_); + salt_ = nullptr; + saltlen_ = 0; + + free(key_); + key_ = nullptr; + keylen_ = 0; + ClearWrap(object()); persistent().Reset(); } @@ -5286,20 +5297,6 @@ class PBKDF2Request : public AsyncWrap { return iter_; } - inline void release() { - free(pass_); - pass_ = nullptr; - passlen_ = 0; - - free(salt_); - salt_ = nullptr; - saltlen_ = 0; - - free(key_); - key_ = nullptr; - keylen_ = 0; - } - inline int error() const { return error_; }