aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Hogan <[email protected]>2019-01-07 06:43:32 -0800
committerDoug Hogan <[email protected]>2019-01-07 20:17:55 -0800
commit7e95687c086f833805d520c33fe96e7e42fc8f6c (patch)
treeae5cbbd27a096e54f88fb886e515c4ad83d32281
parent46a101341ecb4cb800e685f5c1897ed474c4ab7b (diff)
downloadotp-7e95687c086f833805d520c33fe96e7e42fc8f6c.tar.gz
otp-7e95687c086f833805d520c33fe96e7e42fc8f6c.tar.bz2
otp-7e95687c086f833805d520c33fe96e7e42fc8f6c.zip
Revamp engine_ctx_dtor()
Make it NULL safe.
-rw-r--r--lib/crypto/c_src/engine.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/crypto/c_src/engine.c b/lib/crypto/c_src/engine.c
index dc8e1828ce..71552a0a89 100644
--- a/lib/crypto/c_src/engine.c
+++ b/lib/crypto/c_src/engine.c
@@ -32,6 +32,9 @@ static int get_engine_load_cmd_list(ErlNifEnv* env, const ERL_NIF_TERM term, cha
static int zero_terminate(ErlNifBinary bin, char **buf);
static void engine_ctx_dtor(ErlNifEnv* env, struct engine_ctx* ctx) {
+ if (ctx == NULL)
+ return;
+
PRINTF_ERR0("engine_ctx_dtor");
if(ctx->id) {
PRINTF_ERR1(" non empty ctx->id=%s", ctx->id);