File 0309-crypto-Fix-upgrade-bug-when-engine-support-is-missin.patch of Package erlang

From 4b8a81dd49fbeda8f2da118d43f3690a61f2283a Mon Sep 17 00:00:00 2001
From: Sverker Eriksson <sverker@erlang.org>
Date: Thu, 17 May 2018 18:46:41 +0200
Subject: [PATCH 1/2] crypto: Fix upgrade bug when engine support is missing

library_refc was not checked causing crash
when init_digest_types() was called a second time.
---
 lib/crypto/c_src/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 6957d25774..9e7e1e81ae 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -989,6 +989,7 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info)
         PRINTF_ERR0("CRYPTO: Could not open resource type 'ENGINE_CTX'");
         return __LINE__;
     }
+#endif
 
     if (library_refc > 0) {
 	/* Repeated loading of this library (module upgrade).
@@ -996,7 +997,6 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info)
 	 */
 	return 0;
     }
-#endif
 
     atom_true  = enif_make_atom(env,"true");
     atom_false = enif_make_atom(env,"false");
-- 
2.16.3

openSUSE Build Service is sponsored by