From 7bcdf4ef78270c9818fde45816102c1b1288b7c7 Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Fri, 29 Jan 2016 19:53:28 +0100 Subject: [PATCH] Fix two possible leaks Backport of 98637bd Reviewed-by: Kurt Roeckx Reviewed-by: Rich Salz --- crypto/dso/dso_lib.c | 1 + crypto/engine/eng_dyn.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c index 3312450eae..2beb7c1ba5 100644 --- a/crypto/dso/dso_lib.c +++ b/crypto/dso/dso_lib.c @@ -122,6 +122,7 @@ DSO *DSO_new_method(DSO_METHOD *meth) ret->meth = meth; ret->references = 1; if ((ret->meth->init != NULL) && !ret->meth->init(ret)) { + sk_void_free(ret->meth_data); OPENSSL_free(ret); ret = NULL; } diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c index 3169b09ad8..40f30e9d58 100644 --- a/crypto/engine/eng_dyn.c +++ b/crypto/engine/eng_dyn.c @@ -243,8 +243,10 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx) * If we lost the race to set the context, c is non-NULL and *ctx is the * context of the thread that won. */ - if (c) + if (c) { + sk_OPENSSL_STRING_free(c->dirs); OPENSSL_free(c); + } return 1; } -- 2.25.1