Browse Source

src: guard against double free in randomBytes()

PR-URL: https://github.com/nodejs/node/pull/14122
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Ben Noordhuis 8 years ago
parent
commit
ed2a7fbcfe
  1. 1
      src/node_crypto.cc

1
src/node_crypto.cc

@ -5498,6 +5498,7 @@ class RandomBytesRequest : public AsyncWrap {
size_ = 0;
if (free_mode_ == FREE_DATA) {
free(data_);
data_ = nullptr;
}
}

Loading…
Cancel
Save