Check allocate() return code.
This commit is contained in:
parent
88c42e7daa
commit
f0d71f9df0
@ -34,7 +34,7 @@ allocate(void)
|
||||
k2 = _sodium_alignedcalloc(&k2_, crypto_onetimeauth_KEYBYTES +
|
||||
crypto_onetimeauth_BYTES);
|
||||
|
||||
return !(h && m && k && h2 && m2 && k2);
|
||||
return -!(h && m && k && h2 && m2 && k2);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -143,7 +143,9 @@ crypto_onetimeauth_pick_best_implementation(void)
|
||||
(implementations[i]) != 0) {
|
||||
continue;
|
||||
}
|
||||
allocate();
|
||||
if (allocate() != 0) {
|
||||
return NULL;
|
||||
}
|
||||
err = checksum_compute();
|
||||
deallocate();
|
||||
if (err == NULL && strcmp(checksum, CHECKSUM) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user