From dd1abd4462e4e4fa84b8f8de2ec70375f9b0e191 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 28 Sep 2016 23:39:18 +0200 Subject: If an engine comes up explicitely, it must also come down explicitely In apps/apps.c, one can set up an engine with setup_engine(). However, we freed the structural reference immediately, which means that for engines that don't already have a structural reference somewhere else (because it's a built in engine), we end up returning an invalid reference. Instead, the function release_engine() is added, and called at the end of the routines that call setup_engine(). Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1643) --- apps/genpkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/genpkey.c') diff --git a/apps/genpkey.c b/apps/genpkey.c index 93e15d80f1..8f556f371b 100644 --- a/apps/genpkey.c +++ b/apps/genpkey.c @@ -193,8 +193,8 @@ int genpkey_main(int argc, char **argv) EVP_PKEY_CTX_free(ctx); BIO_free_all(out); BIO_free(in); + release_engine(e); OPENSSL_free(pass); - return ret; } -- cgit v1.2.3