Skip to content

Commit e4b7019

Browse files
bnoordhuisaddaleax
authored andcommitted
src: guard against double free in randomBytes()
PR-URL: #14122 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent ad0669b commit e4b7019

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_crypto.cc

+1
Original file line numberDiff line numberDiff line change
@@ -5498,6 +5498,7 @@ class RandomBytesRequest : public AsyncWrap {
54985498
size_ = 0;
54995499
if (free_mode_ == FREE_DATA) {
55005500
free(data_);
5501+
data_ = nullptr;
55015502
}
55025503
}
55035504

0 commit comments

Comments
 (0)