Fix two possible leaks

Backport of 98637bd

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
FdaSilvaYY 2016-01-29 19:53:28 +01:00 committed by Rich Salz
parent e9cf5f0366
commit 7bcdf4ef78
2 changed files with 4 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;
}