From: luxinyou Date: Mon, 7 Sep 2020 08:06:45 +0000 (+1000) Subject: Fix memory leaks in conf_def.c X-Git-Tag: openssl-3.0.0-alpha7~370 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4348995b0d818203f37ffa51c9bdf4488cf24bad;p=thirdparty%2Fopenssl.git Fix memory leaks in conf_def.c Fixes #12471 CLA: trivial Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/12533) --- diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 1d34519d1aa..5475429abdc 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -442,11 +442,13 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) if (biosk == NULL) { if ((biosk = sk_BIO_new_null()) == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); + BIO_free(next); goto err; } } if (!sk_BIO_push(biosk, in)) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); + BIO_free(next); goto err; } /* continue with reading from the included BIO */