Commit c074a4b1 authored by Jesper Louis Andersen's avatar Jesper Louis Andersen
Browse files

If we fail to open the box, release the binary we allocate while doing so.

parent ba0e5e53
......@@ -125,6 +125,7 @@ ERL_NIF_TERM enif_crypto_box_open(ErlNifEnv *env, int argc, ERL_NIF_TERM const a
}
if (crypto_box_open(result.data, padded_ciphertext.data, padded_ciphertext.size, nonce.data, pk.data, sk.data)) {
enif_release_binary(&result);
return nacl_error_tuple(env, "failed_verification");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment