Forget to check malloc

This commit is contained in:
Kagami Hiiragi 2015-01-14 02:53:13 +03:00
parent dfe8c5d07b
commit bcc78bd8e4
2 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,8 @@ NAN_METHOD(Derive) {
} }
uint8_t* shared = (uint8_t *)malloc(PRIVKEY_SIZE); 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); free(shared);
return NanThrowError("Internal error"); return NanThrowError("Internal error");
} }

View File

@ -25,6 +25,7 @@
"crypto", "crypto",
"cryptography", "cryptography",
"secp256k1", "secp256k1",
"K-256",
"elliptic", "elliptic",
"curve" "curve"
], ],