Skip to content

Commit

Permalink
src: remove PBKDF2Request::release()
Browse files Browse the repository at this point in the history
PR-URL: #14122
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
bnoordhuis authored and addaleax committed Jul 18, 2017
1 parent b5802c7 commit 8f4b84b
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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_;
}
Expand Down

0 comments on commit 8f4b84b

Please sign in to comment.