]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix memory leaks in conf_def.c
authorluxinyou <luxinyou@uniontech.com>
Mon, 7 Sep 2020 08:06:45 +0000 (18:06 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Mon, 7 Sep 2020 08:13:01 +0000 (18:13 +1000)
Fixes #12471
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12533)

(cherry picked from commit 4348995b0d818203f37ffa51c9bdf4488cf24bad)

crypto/conf/conf_def.c

index ca76fa3679b8ab3597d009091d8a1029d975ef42..72669b15f9e1bb4d69ba4d7f0ce0398e9552c096 100644 (file)
@@ -376,11 +376,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 */