diff options
author | Doug Hogan <[email protected]> | 2019-01-05 12:24:24 -0800 |
---|---|---|
committer | Doug Hogan <[email protected]> | 2019-01-08 01:11:59 -0800 |
commit | faf4389df139dd17a410066d077811953edbede3 (patch) | |
tree | f78c4567e53f986b727c4d939685afa89a287e84 | |
parent | 7e8f28265c746f2a8993e34159cc0f4c3363832b (diff) | |
download | otp-faf4389df139dd17a410066d077811953edbede3.tar.gz otp-faf4389df139dd17a410066d077811953edbede3.tar.bz2 otp-faf4389df139dd17a410066d077811953edbede3.zip |
Revamp init_cipher_ctx()
-rw-r--r-- | lib/crypto/c_src/cipher.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/crypto/c_src/cipher.c b/lib/crypto/c_src/cipher.c index cda9b15291..175d927ef5 100644 --- a/lib/crypto/c_src/cipher.c +++ b/lib/crypto/c_src/cipher.c @@ -88,13 +88,15 @@ int init_cipher_ctx(ErlNifEnv *env) { (ErlNifResourceDtor*) evp_cipher_ctx_dtor, ERL_NIF_RT_CREATE|ERL_NIF_RT_TAKEOVER, NULL); - if (evp_cipher_ctx_rtype == NULL) { - PRINTF_ERR0("CRYPTO: Could not open resource type 'EVP_CIPHER_CTX'"); - return 0; - } + if (evp_cipher_ctx_rtype == NULL) + goto err; #endif return 1; + + err: + PRINTF_ERR0("CRYPTO: Could not open resource type 'EVP_CIPHER_CTX'"); + return 0; } void init_cipher_types(ErlNifEnv* env) |