Forget to check malloc
This commit is contained in:
parent
dfe8c5d07b
commit
bcc78bd8e4
3
ecdh.cc
3
ecdh.cc
|
@ -86,7 +86,8 @@ NAN_METHOD(Derive) {
|
|||
}
|
||||
|
||||
uint8_t* shared = (uint8_t *)malloc(PRIVKEY_SIZE);
|
||||
if (derive((uint8_t *)privkey_a, (uint8_t *)pubkey_b, shared)) {
|
||||
if (shared == NULL ||
|
||||
derive((uint8_t *)privkey_a, (uint8_t *)pubkey_b, shared)) {
|
||||
free(shared);
|
||||
return NanThrowError("Internal error");
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
"crypto",
|
||||
"cryptography",
|
||||
"secp256k1",
|
||||
"K-256",
|
||||
"elliptic",
|
||||
"curve"
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue
Block a user