From 7e95687c086f833805d520c33fe96e7e42fc8f6c Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Mon, 7 Jan 2019 06:43:32 -0800 Subject: Revamp engine_ctx_dtor() Make it NULL safe. --- lib/crypto/c_src/engine.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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); -- cgit v1.2.3