diff options
author | Doug Hogan <[email protected]> | 2019-01-05 12:32:18 -0800 |
---|---|---|
committer | Doug Hogan <[email protected]> | 2019-01-08 01:11:59 -0800 |
commit | 4e3bc5e7cdb7427a3b6c892fe30e56c63d0b570c (patch) | |
tree | 424f95d2d8c824aebb42b539bf17768e8d051163 | |
parent | faf4389df139dd17a410066d077811953edbede3 (diff) | |
download | otp-4e3bc5e7cdb7427a3b6c892fe30e56c63d0b570c.tar.gz otp-4e3bc5e7cdb7427a3b6c892fe30e56c63d0b570c.tar.bz2 otp-4e3bc5e7cdb7427a3b6c892fe30e56c63d0b570c.zip |
Revamp init_engine_ctx()
-rw-r--r-- | lib/crypto/c_src/engine.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/crypto/c_src/engine.c b/lib/crypto/c_src/engine.c index 4d75f6430b..44648280b4 100644 --- a/lib/crypto/c_src/engine.c +++ b/lib/crypto/c_src/engine.c @@ -103,13 +103,15 @@ int init_engine_ctx(ErlNifEnv *env) { (ErlNifResourceDtor*) engine_ctx_dtor, ERL_NIF_RT_CREATE|ERL_NIF_RT_TAKEOVER, NULL); - if (engine_ctx_rtype == NULL) { - PRINTF_ERR0("CRYPTO: Could not open resource type 'ENGINE_CTX'"); - return 0; - } + if (engine_ctx_rtype == NULL) + goto err; #endif return 1; + + err: + PRINTF_ERR0("CRYPTO: Could not open resource type 'ENGINE_CTX'"); + return 0; } ERL_NIF_TERM engine_by_id_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) |